git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Erik Faye-Lund <kusmabite@gmail.com>
Cc: git@vger.kernel.org, steveire@gmail.com,
	felipe.contreras@gmail.com, gitster@pobox.com
Subject: Re: [PATCH] only warn about ambiguous refs if stderr is a tty
Date: Mon, 9 May 2011 08:49:31 -0400	[thread overview]
Message-ID: <20110509124931.GA18197@sigill.intra.peff.net> (raw)
In-Reply-To: <BANLkTimn7542tji-Uu5iH72HS9fcnaywvg@mail.gmail.com>

On Mon, May 09, 2011 at 02:37:48PM +0200, Erik Faye-Lund wrote:

> Yeah, I understood that part. My point was that once the output is
> wanted for diagnostics, you probably also want verbose output. And
> warnings should probably always be output if we're verbose.

Ah, I see. I think my main concern is that the behavior you proposed
would simply be surprising to people used to normal unix conventions.
But it sounds like we both agree that isn't the right direction anyway.

> > Of course, because there is no refs/HEAD at all. I meant "if you have
> > ambiguity between $GIT_DIR/HEAD and $GIT_DIR/refs/HEAD", then saying
> > "refs/HEAD" should disambiguate already. In your example, there is no
> > ambiguity.
> 
> I meant that "refs/HEAD" could be an non-ambiguous alias for HEAD, but
> it's probably easier to just say that 'HEAD' isn't ambiguous. Your
> suggestion of only checking for ambiguousness on the same level is IMO
> an elegant way of doing this.

OK, I see what you meant. But "refs/HEAD" cannot be a shortcut for
"HEAD", as it means something totally different. You can have "HEAD",
"refs/HEAD", "refs/heads/HEAD" all co-existing.

> I agree. There could be a remote chance that you can get a branch
> called 'HEAD' from some foreign vcs or something, though. But I don't
> think it's very likely, and the problem will also go away if we go
> with your approach mentioned above.

Thinking on it more, I think warning is probably the only sane thing to
do there. Having a branch with that name is just going to be confusing
in the long run, and the sooner we start making the user aware of the
situation, the better.

> > I admit I haven't been following this
> > thread too closely. What is the reason not to tell the user "sorry, that
> > is an insane branch name. Accept the ambiguity warning, or choose a
> > different name"?
> 
> I think having the ambiguity warning in itself isn't the problem, it's
> gitk not swallowing it that is.

Agreed.

> The reporter also had some problems pushing with a branch named 'HEAD'
> in his repo, but I didn't look into that part at all.

I expect that would be a separate issue entirely (if it were fetching, I
wouldn't be surprised if it was the "fake" refs/remotes/*/HEAD symref we
create getting in the way).

-Peff

  reply	other threads:[~2011-05-09 12:49 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-17 10:02 Creating remote branch called HEAD corrupts remote clones Stephen Kelly
2011-01-20 11:14 ` Stephen Kelly
2011-01-20 13:03   ` Thomas Rast
2011-01-20 15:05     ` Stephen Kelly
2011-01-20 15:41       ` Erik Faye-Lund
2011-01-20 16:00         ` Stephen Kelly
2011-01-20 17:32   ` Felipe Contreras
2011-01-20 19:21     ` Wesley J. Landaker
2011-01-20 19:53 ` Junio C Hamano
2011-01-20 20:38   ` Jeff King
2011-01-20 21:43     ` Junio C Hamano
2011-01-20 21:54       ` Jeff King
2011-01-20 23:52         ` Felipe Contreras
2011-01-21 17:37           ` Junio C Hamano
2011-01-22 12:46             ` Felipe Contreras
2011-02-20 13:17               ` Stephen Kelly
2011-04-26 12:09                 ` Stephen Kelly
2011-04-26 18:18                   ` Felipe Contreras
2011-04-27  9:18                     ` Stephen Kelly
2011-04-27  9:48                       ` Felipe Contreras
2011-04-27 11:29                         ` Stephen Kelly
2011-04-27 11:32                           ` Felipe Contreras
2011-04-27 11:37                             ` Stephen Kelly
2011-04-27 12:26                               ` Felipe Contreras
2011-04-27 12:21                           ` Erik Faye-Lund
2011-04-27 12:49                             ` Erik Faye-Lund
2011-05-02 19:26                               ` Stephen Kelly
2011-05-02 19:43                                 ` Erik Faye-Lund
2011-05-03 17:54                                   ` Felipe Contreras
2011-05-03 18:08                                     ` Stephen Kelly
2011-05-03 19:20                                       ` Felipe Contreras
2011-05-04 12:35                                     ` Erik Faye-Lund
2011-05-09  7:51                                       ` [PATCH] only warn about ambiguous refs if stderr is a tty Erik Faye-Lund
2011-05-09  8:03                                         ` Jeff King
2011-05-09  8:41                                           ` Erik Faye-Lund
2011-05-09 10:32                                             ` Jeff King
2011-05-09 12:37                                               ` Erik Faye-Lund
2011-05-09 12:49                                                 ` Jeff King [this message]
2011-05-09 16:33                                                   ` Junio C Hamano
2011-05-09 22:09                                                     ` Jeff King

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=20110509124931.GA18197@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kusmabite@gmail.com \
    --cc=steveire@gmail.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.
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).