Re: How to merge FETCH_HEAD?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Michael S. Tsirkin" <mst@xxxxxxxxxxxxxx> wrote:
> OK, I did a fetch and now I can see remote history by
> 
> $git log FETCH_HEAD

Wow, I'm suprised that works.  Handy feature.  Too bad rev-parse
--verify then chokes on it when we'll somehow consider it a ref
otherwise...
 
> But, how to merge it?

Look at git-pull.sh:

	merge_head=$(sed -e '/  not-for-merge   /d' \
		-e 's/  .*//' "$GIT_DIR"/FETCH_HEAD | \
			tr '\012' ' ')
	merge_name=$(git-fmt-merge-msg <"$GIT_DIR/FETCH_HEAD")
	git-merge "$merge_name" HEAD $merge_head

The not-for-merge keyword is included on lines that were fetched
into tracking branches during the last fetch and which you don't
want to merge right now.  So those lines get dropped.  Then the
remainder of the line is stripped away, leaving you with only
the sha1 sum.  merge_name is computed from the FETCH_HEAD file,
to get the pretty log message for git-merge.

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]