Re: How to merge FETCH_HEAD?
Show 28 quoted lines
> Quoting Shawn O. Pearce <spearce@spearce.org>:
> Subject: Re: How to merge FETCH_HEAD?
>
> "Michael S. Tsirkin" <mst@mellanox.co.il> 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.
Would it be useful to have git-pull . FETCH_HEAD work?
--
MST