git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: What's cooking in git.git (May 2013, #04; Wed, 15)

From
Duy Nguyen <pclouds@gmail.com>
Date
May 27, 2013, 10:36 UTC
Message-ID
<CACsJy8Ct-ei7qbAW4qviQ6=q93ygxDcxRs9F3iHHV4-4Qz6qUA@mail.gmail.com>
In-Reply-To
<7vk3mtwrq9.fsf@alter.siamese.dyndns.org>
On Mon, May 20, 2013 at 11:17 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 31 quoted lines
> Think why the user has such a hard to type ref in the first place.
> The user may have done this previously, thinking that he is detaching
> the HEAD to fix an earlier mistake in a branch:
>
>     $ BAD_COMMIT=$(git rev-parse nd/magic~8)
>     $ git checkout $BAD_COMMIT
>
> but by mistake gave a "-b" after "checkout", i.e.
>
>     $ git checkout -b $BAD_COMMIT
>
> After this, commands that want to work on branch name would still
> work as "expected", with the expectation being the user would be
> working on the refs/heads/$BAD_COMMIT branch, e.g.
>
>     $ git checkout $BAD_COMMIT
>     $ git branch -m $BAD_COMMIT nd/magic-fix
>
> but commands that want to work on commit object name will resolve it
> to the $BAD_COMMIT object (i.e. nd/magic~8), e.g.
>
>     $ git log $BAD_COMMIT
>
> and needs disambiguation if the user wants to work on the commit at
> the tip of the branch, e.g.
>
>     $ git log heads/$BAD_COMMIT
>
> So we really do want the users to notice and take corrective action,
> and one way to attract the attention of the users is to phrase the
> message more explicitly to let them know what is going on.
Point taken. I guess the message would be something like this?
Refname '%.*s' is ignored. It may be created by mistake.

Or should we be more elaborate? -- Duy

Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 9 in “What's cooking in git.git (May 2013, #04; Wed, 15)”
  1. Junio C HamanoMay 15, 2013
  2. David AguilarMay 16, 2013
  3. Duy NguyenMay 20, 2013
  4. Junio C HamanoMay 20, 2013
  5. Thomas RastMay 21, 2013
  6. Junio C HamanoMay 21, 2013
  7. Duy NguyenMay 27, 2013
  8. Junio C HamanoMay 28, 2013
  9. Felipe ContrerasMay 20, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.