git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Marc Branchaud <marcnarc@xiplink.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: What should "git fetch origin +next" should do?
Date: Mon, 17 Oct 2011 10:35:19 -0400	[thread overview]
Message-ID: <4E9C3D27.3060504@xiplink.com> (raw)
In-Reply-To: <7v7h45s8rh.fsf@alter.siamese.dyndns.org>

On 11-10-16 03:20 AM, Junio C Hamano wrote:
> As some might know, I use the traditional non-separate-remotes layout in
> many of my working trees. I am old fashioned.

Being hip and modern :) I use separate remote refspecs.  As I read your post,
I kept thinking that it makes no sense for fetch to ever update local refs
and that you're a victim of your stodgy old ways.

> I just tried to update one of them with "git pull --ff-only", and after
> seeing that the fetch phase failed with non-ff on 'next', ran
> 
> 	$ git fetch origin +next
> 
> which happily copied the tip of updated next to FETCH_HEAD and nowhere
> else. Of course, a colon-less refspec means do not store it anywhere,
> i.e. "<colon-less-refspec>" === "<colon-less refspec>:", so prefixing it
> with '+' to force would logically be a no-op.  But it nevertheless was
> somewhat surprising and irritating.
> 
> This is one of the many things that is so minor that it probably is not
> worth risking backward compatibility issues to change, but something that
> we would design differently if we were starting from scratch. Maybe in Git
> 2.0.
> 
> The question however is what should it do. I can see three possibilities:
> 
>  (1) Forcing to fetch into FETCH_HEAD does not make any sense, so instead
>      of silently ignoring the '+' prefix, error it out and do not fetch
>      anything. This is easy to explain and logically makes more sense than
>      the current behaviour.

I think this makes the most sense.

I'd even go so far as to make fetch error out if there's a colon in the
refspec.  Fetch has no business updating local refs.  There are other
commands for that, and which command you use depends on how you want your
local ref updated.  I think it would be a mistake to start going down a path
where fetch learns different ways to update a local ref.  Madness!

		M.

  reply	other threads:[~2011-10-17 14:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-16  7:20 What should "git fetch origin +next" should do? Junio C Hamano
2011-10-17 14:35 ` Marc Branchaud [this message]
2011-10-17 16:15   ` Ramkumar Ramachandra
2011-10-17 17:09   ` Junio C Hamano
2011-10-17 16:10 ` Ramkumar Ramachandra
2011-10-17 17:10 ` Jeff King
2011-10-17 18:34   ` Junio C Hamano
2011-10-17 22:02     ` Marc Branchaud
2011-10-19  4:31       ` Junio C Hamano
2011-10-19 13:45         ` Marc Branchaud

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=4E9C3D27.3060504@xiplink.com \
    --to=marcnarc@xiplink.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).