Re: Git questions

2012-07-18 Thread Jeremy Dunck
On Fri, Jun 8, 2012 at 7:57 AM, Anssi Kääriäinen
 wrote:
> On 8 kesä, 17:28, Luke Plant  wrote:
>> First, thanks so much to Aymeric and Anssi and others for the
>> contribution guidelines, they're very helpful.
>>
>> I've got some questions that are due to my ignorance of git (I have
>> managed to avoid it as something I need in daily use, I still think it's
>> got a brain-damaged UI...)
>>
>> In this section:
>>
>> https://docs.djangoproject.com/en/dev/internals/contributing/committi...
>>
>> it's written you can use this:
>>
>>   git push --dry-run upstream master
>>
>> to check outgoing changes. However for me the output of that command is
>> a short and very unhelpful message, something like this:
>>
>> To g...@github.com:django/django.git
>>45d4331..2d5f9e4  master -> master
>
> The idea is you do next "git log" to see what are the actual changes.
>
>> The alternative for checking outgoing changes that I've found is using log:
>>
>>   git log -p upstream/master..master
>>
>> However, I've found this doesn't work as I expect sometimes, because
>> somehow after a pull, the branch pointer for 'remotes/upstream/master'
>> has not been updated to where I expect it to be (the last commit pulled
>> from upstream), but is left where it was. I've observed this several
>> times. If I do 'git fetch upstream', rather than 'git pull upstream
>> master', then the pointers always update, but I thought the whole point
>> of doing 'pull' was 'pull=fetch then merge'.  Am I doing something wrong?

Actually, I think what is going on here is that git-pull does a
fetch-and-merge of whatever the branch is set to track upstream.  This
may not be the branch you hope/expect it to be.

"
   When a local branch is started off a remote-tracking branch,
git sets up the branch so that git
   pull will appropriately merge from the remote-tracking branch.
This behavior may be changed via the
   global branch.autosetupmerge configuration flag. That setting
can be overridden by using the
   --track and --no-track options, and changed later using git
branch --set-upstream.
"

If you create a local branch from another local branch, I believe the
new branch gets the same upstream branch that the original local
branch had.

To see what branch your local is tracking (if any):
$ git branch --list -vv

For example, my output there includes:
  master  76d5daa [upstream/master] Changed `manage.py
shell`'s help text to reflect that it can invoke bpython.
  virtual_signals c8dc85d [votizen/virtual_signals: ahead 1] Clarify args

If you find your local is on the wrong branch, you can set it like so:

git branch --set-upstream  

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Git questions

2012-06-08 Thread Anssi Kääriäinen
On 8 kesä, 17:28, Luke Plant  wrote:
> First, thanks so much to Aymeric and Anssi and others for the
> contribution guidelines, they're very helpful.
>
> I've got some questions that are due to my ignorance of git (I have
> managed to avoid it as something I need in daily use, I still think it's
> got a brain-damaged UI...)
>
> In this section:
>
> https://docs.djangoproject.com/en/dev/internals/contributing/committi...
>
> it's written you can use this:
>
>   git push --dry-run upstream master
>
> to check outgoing changes. However for me the output of that command is
> a short and very unhelpful message, something like this:
>
> To g...@github.com:django/django.git
>    45d4331..2d5f9e4  master -> master

The idea is you do next "git log" to see what are the actual changes.

> The alternative for checking outgoing changes that I've found is using log:
>
>   git log -p upstream/master..master
>
> However, I've found this doesn't work as I expect sometimes, because
> somehow after a pull, the branch pointer for 'remotes/upstream/master'
> has not been updated to where I expect it to be (the last commit pulled
> from upstream), but is left where it was. I've observed this several
> times. If I do 'git fetch upstream', rather than 'git pull upstream
> master', then the pointers always update, but I thought the whole point
> of doing 'pull' was 'pull=fetch then merge'.  Am I doing something wrong?

This is the problem. If you use git push --dry-run git will actually
contact the upstream and see the current state of it. If you do git
log in local copy, some changes in the upstream might not be visible.
If there was a way to do dry-run + show the log of changes in one go
that would be perfect, but I don't know of a command doing that. Maybe
a short shell script doing git fetch upstream && git log -p upstream/
master..master

In any case there is room for improvement in the docs.

 - Anssi

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Git questions

2012-06-08 Thread Luke Plant
First, thanks so much to Aymeric and Anssi and others for the
contribution guidelines, they're very helpful.

I've got some questions that are due to my ignorance of git (I have
managed to avoid it as something I need in daily use, I still think it's
got a brain-damaged UI...)

In this section:

https://docs.djangoproject.com/en/dev/internals/contributing/committing-code/#handling-pull-requests

it's written you can use this:

  git push --dry-run upstream master

to check outgoing changes. However for me the output of that command is
a short and very unhelpful message, something like this:

To g...@github.com:django/django.git
   45d4331..2d5f9e4  master -> master

How is this supposed to help me check the outgoing changes? Do I need to
change something in my config?

The alternative for checking outgoing changes that I've found is using log:

  git log -p upstream/master..master

However, I've found this doesn't work as I expect sometimes, because
somehow after a pull, the branch pointer for 'remotes/upstream/master'
has not been updated to where I expect it to be (the last commit pulled
from upstream), but is left where it was. I've observed this several
times. If I do 'git fetch upstream', rather than 'git pull upstream
master', then the pointers always update, but I thought the whole point
of doing 'pull' was 'pull=fetch then merge'.  Am I doing something wrong?

Thanks in advance,

Luke

-- 
OSBORN'S LAW
Variables won't, constants aren't.

Luke Plant || http://lukeplant.me.uk/

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.