Thread (12 messages) 12 messages, 5 authors, 2016-06-15

Re: How to merge FETCH_HEAD?

flat view

From: Michael S. Tsirkin <hidden>
Date: 2016-06-15 22:42:49

Quoting Shawn O. Pearce [off-list ref]:
Subject: Re: How to merge FETCH_HEAD?

"Michael S. Tsirkin" [off-list ref] wrote:
quoted
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...
 
quoted
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.
Would it be useful to have git-pull . FETCH_HEAD work?

-- 
MST
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help