git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: Re: FETCH_HEAD question
Date: Tue, 17 Feb 2009 00:11:04 -0500	[thread overview]
Message-ID: <76718490902162111o373065bwb74a187b016beb0a@mail.gmail.com> (raw)
In-Reply-To: <76718490902162043k78e615b5g7ba4b7ac95e73b18@mail.gmail.com>

On Mon, Feb 16, 2009 at 11:43 PM, Jay Soffian <jaysoffian@gmail.com> wrote:
> I did this the other day out of mild curiosity:
>
> $ git fetch
> $ git merge FETCH_HEAD
>
> Which did something, but not something that was at all useful. It
> merges in the first ref listed in FETCH_HEAD. It does not appear to be
> an accident that it does this, as git merge has special treatment for
> FETCH_HEAD to generate the merge message.
>
> Why does this behavior exist? Historical?

To be clear, this seems only to be useful if you are only fetching a
single branch from remote. Otherwise the branch which you end up
merging (the first alphabetically) may very well not be what the
current checked-out branch is based on.

So to work correctly in the case of pulling multiple branches,
dwim_ref() would have to return the sha1 corresponding to the single
line in FETCH_HEAD that is not marked "not-for-merge" and git merge
would similarly need to use that line for the merge message. Or git
fetch would need to place the non-not-for-merge ref first in the file.

I found this in the archives, but it didn't really answer my question
about why it got implemented the current way:

http://thread.gmane.org/gmane.comp.version-control.git/42788/focus=42850

j.

  reply	other threads:[~2009-02-17  5:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17  4:43 FETCH_HEAD question Jay Soffian
2009-02-17  5:11 ` Jay Soffian [this message]
2009-02-17  5:36 ` Junio C Hamano
2009-02-17  6:21   ` Jay Soffian
2009-02-17  7:18     ` Junio C Hamano
2009-02-17  7:41       ` Jay Soffian
2009-02-17  8:35         ` Junio C Hamano
2009-02-17 17:14           ` Jay Soffian
2009-02-17 17:22             ` Johannes Schindelin
2009-02-17 17:34               ` Jay Soffian
2009-02-17 22:58                 ` PUSH_HEAD, was " Johannes Schindelin
2009-02-17 23:43                   ` Junio C Hamano
2009-02-18  0:29                     ` Jay Soffian
2009-02-18  0:30                     ` Johannes Schindelin
2009-02-17  8:25     ` Sitaram Chamarty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76718490902162111o373065bwb74a187b016beb0a@mail.gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).