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

Re: [PATCH 2/2] sha1_name: fix error message for @{<N>}, @{<date>}

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 22, 2013, 20:39 UTC
Message-ID
<CAPig+cQwcNxvvXZ_PFtUZ3HnH5tdpsL8RLQ02dTDz37y0XpJhg@mail.gmail.com>
In-Reply-To
<1369219195-20096-3-git-send-email-artagnon@gmail.com>

On Wed, May 22, 2013 at 6:39 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:

Show 19 quoted lines
> Currently, when we try to resolve @{<N>} or @{<date>} when the reflog
> doesn't go back far enough, we get errors like:
>
>   # on branch master
>   $ git show @{10000}
>   fatal: Log for '' only has 7 entries.
>
>   $ git show @{10000.days.ago}
>   warning: Log for '' only goes back to Tue, 21 May 2013 14:14:45 +0530.
>   ...
>
>   # detached HEAD case
>   $ git show @{10000}
>   fatal: Log for '' only has 2005 entries.
>
>   $ git show master@{10000}
>   fatal: Log for 'master' only has 7 entries.
>
> The empty string '' is ugly, inconsistent, and failing to convey
s/failing/fails/
Show 22 quoted lines
> information about whose logs we are inspecting.  Change this so that we
> get:
>
>   # on branch master
>   $ git show @{10000}
>   fatal: Log for 'master' only has 7 entries.
>
>   $ git show @{10000.days.ago}
>   warning: Log for 'master' only goes back to Tue, 21 May 2013 14:14:45 +0530.
>   ...
>
>   # detached HEAD case
>   $ git show @{10000}
>   fatal: Log for 'HEAD' only has 2005 entries.
>
>   $ git show master@{10000}
>   fatal: Log for 'master' only has 7 entries.
>
> Simple, consistent, and informative; suitable for output even from
> plumbing commands like rev-parse.
>
> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Previous: Ramkumar Ramachandra
Message 6 of 6 in “Fix invalid revision error messages”
  1. 0/2 Fix invalid revision error messagesRamkumar Ramachandra, May 22, 2013
  2. 1/2 sha1_name: fix error message for @{u}Ramkumar Ramachandra, May 22, 2013
  3. Junio C HamanoMay 22, 2013
  4. Ramkumar RamachandraMay 23, 2013
  5. 2/2 sha1_name: fix error message for @{<N>}, @{<date>}Ramkumar Ramachandra, May 22, 2013
  6. Eric SunshineMay 22, 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.