Re: Friendly refspecs (Was: Re: git annoyances)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git@...>
Date: Wednesday, April 9, 2008 - 4:34 pm

On Wed, Apr 09, 2008 at 11:08:36PM +0300, Teemu Likonen wrote:


This has been discussed before and rejected, because the point of doing
a fetch of a URL (rather than a remote name) is to do a "one-off" thing.
IOW, you don't _want_ the tracking branches, as they will just clutter
your branch space (plus choosing the last component is a bad heuristic;
lots of people must ask Linus to pull from their .../linux-2.6
repository).

Almost nobody says "git fetch <URL>"; it is just a subpart of "git
pull <URL>" which is intended for one-off merges (i.e., you are not
tracking somebody over the long term, you just want to grab their work
and merge it).


It does; it puts the refs into FETCH_HEAD. Maybe a status table like the
usual one would be more informative, like:

  From git://host/path/to/repo
   * [new branch]      foo -> FETCH_HEAD

though again, it would help if we could see a workflow that uses "git
fetch <URL>" for something. I think the simplest answer in your case is
"don't use git fetch <URL>".


Sure. There is an explicit design decision that "because you gave this
thing a nickname, you are probably interested in keeping its tracking
branches around."


It would probably be nice if "git fetch name foo" saved the remote
tracking branch remotes/name/foo, which it doesn't currently. But
whether to do it with a URL is orthogonal; it depends on whether we use
tracking branches for URLs in general, as you suggested above.


We almost have that. It's actually spelled:

  git fetch <URL|name> <Rbranch>:remotes/<Lbranch>

But again, what is the workflow? There are generally two ways of
fetching:

  1. I am tracking some remote with multiple branches. I give it a
     remote name (either by editing the config file or by using
     git-remote). When i want to get updates, I do "git fetch <name>",
     and then I can work with the <name>/* branches as I want (diffing,
     merging, etc).

  2. "Somehow" I found out about something interesting in a particular
     branch of a particular repo. I want to pull that in to see the
     work, so I use "git pull <repo> <branch>". Alternatively, if I
     prefer to fetch and examine before pulling (even though the merge
     can of course be cancelled easily), I can "git fetch <repo>
     <branch>", followed by "git diff HEAD FETCH_HEAD", followed by "git
     merge FETCH_HEAD".

It seems like you are getting caught up on using "git fetch" in
different ways that don't really make sense to its original use. So the
problem is not so much one of "fetch doesn't do what I want it to do" as
much as "it is easy to be confused about what it is I want to do."

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git annoyances, Ingo Molnar, (Wed Apr 9, 6:14 am)
Re: git annoyances, Daniel Barkalow, (Wed Apr 9, 3:21 pm)
Re: git annoyances, Ingo Molnar, (Wed Apr 9, 4:41 pm)
Re: git annoyances, Daniel Barkalow, (Thu Apr 10, 10:08 am)
Re: git annoyances, Junio C Hamano, (Wed Apr 9, 5:04 pm)
Re: git annoyances, André Goddard Rosa, (Wed Apr 9, 7:56 pm)
Re: git annoyances, Govind Salinas, (Thu Apr 10, 3:45 pm)
Re: git annoyances, Jean-Christian de Rivaz, (Thu Apr 10, 2:08 am)
Re: git annoyances, Sverre Rabbelier, (Thu Apr 10, 4:19 am)
Re: git annoyances, Jon Loeliger, (Wed Apr 9, 5:39 pm)
Re: git annoyances, Nicolas Pitre, (Wed Apr 9, 7:45 pm)
Re: git annoyances, Jeff King, (Wed Apr 9, 5:45 pm)
Re: git annoyances, Luciano Rocha, (Fri Apr 11, 6:15 am)
Re: git annoyances, Wincent Colaiuta, (Fri Apr 11, 6:27 am)
git-bisect annoyances, Ingo Molnar, (Thu Apr 10, 7:47 am)
Re: git-bisect annoyances, Junio C Hamano, (Fri Apr 11, 1:56 am)
Re: git-bisect annoyances, Christian Couder, (Fri Apr 11, 1:41 am)
Re: git-bisect annoyances, Ingo Molnar, (Fri Apr 11, 7:41 am)
Re: git-bisect annoyances, Christian Couder, (Sat Apr 12, 2:56 am)
Re: git annoyances, Jeff King, (Wed Apr 9, 10:57 am)
Re: git annoyances, Avery Pennarun, (Wed Apr 9, 1:08 pm)
Re: git annoyances, Karl , (Thu Apr 10, 4:41 am)
Re: git annoyances, Avery Pennarun, (Thu Apr 10, 11:05 am)
Re: git annoyances, Karl , (Fri Apr 11, 3:00 am)
Friendly refspecs (Was: Re: git annoyances), Teemu Likonen, (Wed Apr 9, 4:08 pm)
Re: Friendly refspecs, Junio C Hamano, (Wed Apr 9, 5:21 pm)
Re: Friendly refspecs, Teemu Likonen, (Thu Apr 10, 3:38 am)
Re: Friendly refspecs (Was: Re: git annoyances), Avery Pennarun, (Wed Apr 9, 4:32 pm)
Re: Friendly refspecs (Was: Re: git annoyances), Jeff King, (Wed Apr 9, 4:34 pm)
Re: Friendly refspecs (Was: Re: git annoyances), Teemu Likonen, (Wed Apr 9, 6:25 pm)
Re: Friendly refspecs (Was: Re: git annoyances), Jeff King, (Wed Apr 9, 6:51 pm)
Re: Friendly refspecs, Teemu Likonen, (Sun Apr 13, 5:31 am)
Re: Friendly refspecs, Jeff King, (Tue Apr 15, 11:48 pm)
Re: Friendly refspecs, Daniel Barkalow, (Wed Apr 16, 11:42 am)
Re: Friendly refspecs, Junio C Hamano, (Wed Apr 16, 12:41 am)
Re: Friendly refspecs, Jeff King, (Wed Apr 16, 12:47 am)
Re: Friendly refspecs, Jeff King, (Wed Apr 16, 12:25 am)
[PATCH] Add examples section to 'git fetch' manual, Teemu Likonen, (Sun Apr 13, 5:34 am)
Re: [PATCH] Add examples section to 'git fetch' manual, Junio C Hamano, (Sun Apr 13, 2:56 pm)
Re: [PATCH] Add examples section to 'git fetch' manual, Teemu Likonen, (Sun Apr 13, 4:05 pm)
Re: [PATCH] Add examples section to 'git fetch' manual, Junio C Hamano, (Sun Apr 13, 9:02 pm)
Re: [PATCH] Add examples section to 'git fetch' manual, Matt Graham, (Sun Apr 13, 3:48 pm)
Re: Friendly refspecs (Was: Re: git annoyances), Jeff King, (Wed Apr 9, 8:03 pm)
Re: Friendly refspecs (Was: Re: git annoyances), Jeff King, (Wed Apr 9, 8:11 pm)
Re: Friendly refspecs, Junio C Hamano, (Thu Apr 10, 3:51 am)
Re: Friendly refspecs, Jeff King, (Thu Apr 10, 4:03 am)
Re: [PATCH] git-remote: show all remotes with "git remote sh..., Johannes Schindelin, (Wed Apr 9, 12:54 pm)
Re: git annoyances, Björn, (Wed Apr 9, 6:41 am)
Re: [PATCH] When a remote is added but not fetched, tell the..., Johannes Schindelin, (Fri Apr 11, 11:21 am)
Re: [PATCH] Default to fetching a remote after adding it., Wincent Colaiuta, (Fri Apr 11, 3:36 pm)
Re: [PATCH] Default to fetching a remote after adding it., Johannes Schindelin, (Sat Apr 12, 10:33 am)
Re: [PATCH] Default to fetching a remote after adding it., Johannes Schindelin, (Sat Apr 12, 11:24 am)
Re: [PATCH] Default to fetching a remote after adding it., Stephen Sinclair, (Fri Apr 11, 3:17 pm)