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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:26

Ramkumar Ramachandra [off-list ref] writes:
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 fails to convey
information about whose logs we are inspecting.  Change this so that we
What is this meant to update?  I recall rewriting this part on
purpose.

Even though it appears unusual and invites confusion, it is very
consistent to say '' when the user asks for @... as we say 'master'
when the user asks for master@...; "inconsistent" is a very bad
label for it.

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

From: Ramkumar Ramachandra <hidden>
Date: 2016-06-15 22:57:26

Junio C Hamano wrote:
What is this meant to update?  I recall rewriting this part on
purpose.
I was being verbose to show that I handle the detached HEAD case too,
which I missed last time.
Even though it appears unusual and invites confusion, it is very
consistent to say '' when the user asks for @... as we say 'master'
when the user asks for master@...; "inconsistent" is a very bad
label for it.
The inconsistency refers to these two:
quoted
  # on branch master
  $ git show @{10000}
  fatal: Log for '' only has 7 entries.
quoted
  # detached HEAD case
  $ git show @{10000}
  fatal: Log for '' only has 2005 entries.
Is the commit message unclear?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help