summaryrefslogtreecommitdiff
path: root/reflog-walk.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-05-04 05:27:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-05-04 16:39:14 (GMT)
commit794151e9b595ddc2700c0801caabfd27be763e12 (patch)
tree37a4fb7019e2fad502b9b4d283809d440eea2365 /reflog-walk.h
parenta763126b5c0120057908e939a0ff7cc95f899f69 (diff)
downloadgit-794151e9b595ddc2700c0801caabfd27be763e12.zip
git-794151e9b595ddc2700c0801caabfd27be763e12.tar.gz
git-794151e9b595ddc2700c0801caabfd27be763e12.tar.bz2
reflog-walk: always make HEAD@{0} show indexed selectors
When we are showing reflog selectors during a walk, we infer from context whether the user wanted to see the index in each selector, or the reflog date. The current rules are: 1. if the user asked for an explicit date format in the output, show the date 2. if the user asked for ref@{now}, show the date 3. if neither is true, show the index However, if we see "ref@{0}", that should be a strong clue that the user wants to see the counted version. In fact, it should be much stronger than the date format in (1). The user may have been setting the date format to use in another part of the output (e.g., in --format="%gd (%ad)", they may have wanted to influence the author date). This patch flips the rules to: 1. if the user asked for ref@{0}, always show the index 2. if the user asked for ref@{now}, always show the date 3. otherwise, we have just "ref"; show them counted by default, but respect the presence of "--date" as a clue that the user wanted them date-based Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reflog-walk.h')
0 files changed, 0 insertions, 0 deletions