Re: git pull and merging.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Aneesh Kumar K.V <aneesh.kumar@...>
Cc: Johannes Schindelin <Johannes.Schindelin@...>, Junio C Hamano <junkio@...>, <git@...>
Date: Thursday, December 7, 2006 - 7:27 am

On Thursday 07 December 2006 07:46, Aneesh Kumar K.V wrote:


Yes.


No. The merging part actually is the easiest, because everything about
what to merge with what is already decided in "git pull" 's fetch phase:

* git fetch leaves the branches fetched _and_ what to merge of them
in .git/FETCH_HEAD. Example for "git pull" it git.git's master(shorted):

de51fa... branch 'master' of git://.../git/git
49ed2b... not-for-merge   branch 'maint' of git://.../git/git
b772ef... not-for-merge   branch 'next' of git://.../git/git

Which means: Already in the fetch phase, we look up branch.*.merge to
decide what to write into this file.

* the merge phase just looks up .git/FETCH_HEAD and merges all branches into
the current branch which are _not_ marked as "not-for-merge". There
is nothing tricky here: We did the 1st phase of pull in the same
"current" branch, so there really is no need to check any branch.*.merge
value again.


Yes. But the value of branch.*.merge, which is the _remote_ side of such a refspec
tracking specification given in remote.*.fetch's, will be checked against all
remote parts of refspecs fetched in the 1st phase of "git pull". And it is already
decided in the fetch phase what to merge.

Now looking at it, I think this semantic really is screwed and utterly confusing.
Why decides branch.*.merge about actions done in fetch (I think even if you did
"git fetch" alone)? OK, actually, that is an implementation detail and not
really important.

More important: Because "branch.*.merge" specifies a _remote_ branch,
the user has to understand that this info is already used in the fetch.
The intuitive mental model of a user about how it works IMHO is that
"branch.*.merge" is checked in the merge phase (as the name of the option suggests).
But this way, how could the merge phase know about any remote branch at all,
which does not need to be touched at all in the merge phase?

IMHO we should somehow change the semantic of branch.*.merge to specify the _local_
refspec part, as this is the branch which actually gets merged.
This is the only way that a user could grasp the meaning of it.
Perhaps introduce "branch.*.defaultmerge", and obsoleting "branch.*.merge"?


This is not forced, but can be changed by configuration.


?

Josef
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git pull and merging., Aneesh Kumar, (Wed Dec 6, 12:51 am)
Re: git pull and merging., Junio C Hamano, (Wed Dec 6, 1:02 am)
Re: git pull and merging., Aneesh Kumar, (Wed Dec 6, 1:21 am)
Re: git pull and merging., Johannes Schindelin, (Wed Dec 6, 5:26 am)
Re: git pull and merging., Aneesh Kumar, (Wed Dec 6, 6:05 am)
Re: git pull and merging., Josef Weidendorfer, (Wed Dec 6, 12:44 pm)
Re: git pull and merging., Aneesh Kumar K.V, (Thu Dec 7, 2:46 am)
Re: git pull and merging., Josef Weidendorfer, (Thu Dec 7, 7:27 am)
Re: git pull and merging., Junio C Hamano, (Thu Dec 7, 3:06 pm)
Re: git pull and merging., Junio C Hamano, (Thu Dec 7, 7:06 pm)
Re: git pull and merging., , (Thu Dec 7, 10:04 pm)
Re: git pull and merging., Josef Weidendorfer, (Thu Dec 7, 6:54 pm)
Re: git pull and merging., Junio C Hamano, (Fri Dec 8, 3:07 am)
Re: git pull and merging., , (Thu Dec 7, 9:56 pm)
Re: git pull and merging., Josef Weidendorfer, (Fri Dec 8, 1:23 pm)
Re: git pull and merging., , (Fri Dec 8, 4:09 pm)
[PATCH] Add branch.*.localmerge and documentation update, Josef Weidendorfer, (Fri Dec 8, 3:12 pm)
Re: [PATCH] Add branch.*.localmerge and documentation update, Josef Weidendorfer, (Fri Dec 8, 5:39 pm)
Re: [PATCH] Add branch.*.localmerge and documentation update, Josef Weidendorfer, (Fri Dec 8, 6:01 pm)
Re: [PATCH] Add branch.*.localmerge and documentation update, Josef Weidendorfer, (Fri Dec 8, 7:17 pm)
[PATCH] Add branch.*.merge warning and documentation update, Josef Weidendorfer, (Fri Dec 8, 9:28 pm)