git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mikael Magnusson" <mikachu@gmail.com>
To: "Brandon Casey" <casey@nrlssc.navy.mil>
Cc: "Daniel Barkalow" <barkalow@iabervon.org>,
	"Rene Herman" <rene.herman@keyaccess.nl>,
	git <git@vger.kernel.org>,
	"Miklos Vajna" <vmiklos@frugalware.org>
Subject: Re: "git pull . <branch>" versus "git merge <branch>"
Date: Wed, 11 Jun 2008 23:49:49 +0200	[thread overview]
Message-ID: <237967ef0806111449i7d23976dxa3290eece06b5876@mail.gmail.com> (raw)
In-Reply-To: <kpNEshc02wSu18FDnzOIvMAjQu_lmbk4tK_T_9HGh38@cipher.nrlssc.navy.mil>

2008/6/11 Brandon Casey <casey@nrlssc.navy.mil>:
> Daniel Barkalow wrote:
>> On Wed, 11 Jun 2008, Brandon Casey wrote:
>>
>>> Daniel Barkalow wrote:
>>>> On Wed, 11 Jun 2008, Rene Herman wrote:
>>>>
>>>>> Good day.
>>>>>
>>>>> The manpages seem to be making somewhat of a point of mentioning "git pull .
>>>>> <branch>" as the way to merge a local branch into the current one but a simple
>>>>> "git merge <branch>" seems to work well. Is there a difference?
>>>> Those manpage sections predate the existance of "git merge <branch>". If
>>>> you're not planning to use git before November 2006, there's no reason to
>>>> use the "git pull ." form. They should probably be replaced with more
>>>> helpful examples at this point.
>>> Was there some past discussion of the ui merits of a separate 'merge' command
>>> for dealing with local merges and a 'pull' command for remote merges? I
>>> understand merge is the backend. The question has to do with the high-level
>>> user interface: one command or two? Why wasn't git-pull enough?
>>
>> "git pull . <branch>" does "git fetch . <branch>" and then merges it. Of
>> course, "git fetch . <branch>" does nothing at all, and it's weird as a
>> user interface to have the only (simple) way of selecting something to
>> merge be to fetch it as if from a remote repository, but from the local
>> repository. After all, no other purely local operation requires you to
>> first fetch the thing you're interesting in from yourself.
>
> I don't agree with this paragraph. I think it _would_ be weird if you had
> to type 'git fetch' and then 'git merge' (or git pull) when operating on
> a local repository, but that is not necessary. It is only necessary to
> type 'git pull'. There is symmetry between operating on a remote repository
> and operating on a local repository. The user does not need to know that
> a noop fetch is first performed, or whether the pull command detects that
> it is operating on a local repository and just skips the fetch, any more than
> the user is required to know the exact sequence of events that allows an ssh
> session to succeed.

> The user _must_ know how to use git-pull

I've used git for a couple of months, and I've never used git-pull, only fetch
and merge. To me it doesn't make any sense that you would want to merge changes
without looking at them first. It also seems very strange to me to treat
not-yet-fetched branches on a remote the same as a local branch. I don't really
have any useful input other than that you shouldn't assume what other people
find intuitive, because you are usually wrong :).

> Well maybe that exaggerates the point a little, git-merge is not that complicated,
> but it is an additional command to learn with little benefit that I see.

For me, git-pull is that additional command, and using git-pull .
<branch> to merge
feels really really strange. Why would I pull something I already have?

> I saw it as something similar to suggestions I've seen to use git-reflog
> (not porcelain) rather than 'git-log -g' (porcelain).

The output of git-reflog is easier to read when you know what you're
looking for,
the actual commit message and author info that log outputs is usually
superfluous.

-- 
Mikael Magnusson

  reply	other threads:[~2008-06-11 21:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-11  0:51 "git pull . <branch>" versus "git merge <branch>" Rene Herman
2008-06-11  1:06 ` David Symonds
2008-06-11  1:13   ` Rene Herman
2008-06-11  1:56     ` Miklos Vajna
2008-06-11  2:01       ` Rene Herman
2008-06-11  2:04       ` Paolo Bonzini
2008-06-11  2:09         ` Rene Herman
2008-06-11  5:23           ` Paolo Bonzini
2008-06-11 17:56 ` Daniel Barkalow
2008-06-11 18:32   ` Brandon Casey
2008-06-11 19:46     ` Daniel Barkalow
2008-06-11 21:01       ` Brandon Casey
2008-06-11 21:49         ` Mikael Magnusson [this message]
2008-06-12  0:56           ` Rene Herman
2008-06-11 23:01 ` Junio C Hamano
2008-06-12  1:00   ` Rene Herman

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=237967ef0806111449i7d23976dxa3290eece06b5876@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=barkalow@iabervon.org \
    --cc=casey@nrlssc.navy.mil \
    --cc=git@vger.kernel.org \
    --cc=rene.herman@keyaccess.nl \
    --cc=vmiklos@frugalware.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).