author | Thomas Rast <trast@student.ethz.ch> | |
Thu, 13 Aug 2009 07:25:03 +0000 (09:25 +0200) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Thu, 13 Aug 2009 11:49:12 +0000 (21:49 +1000) | ||
commit | 9bf3acfadafe9e5961296ff22a1677a9f5afe508 | |
tree | 7f86f6c28aa6e4688cf2ef2832658deb14b2dee4 | tree | snapshot |
parent | 2b1fbf90aa9c0fb2a1033793728aebf77c11334d | commit | diff |
gitk: Parse arbitrary commit-ish in SHA1 field
We only accepted either SHA1s or heads/tags that have been read. This
meant the user could not, e.g., enter HEAD to go back to the current
commit.
This adds code to call out to git rev-parse --verify if all other
methods of interpreting the string the user entered fail.
(git-rev-parse alone is not enough as we really want a single
revision.)
The error paths change slighly, because we now know from the rev-parse
invocation whether the expression was valid at all. The previous
"unknown" path is now only triggered if the revision does exist, but
is not in the current view display.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Paul Mackerras <paulus@samba.org>
We only accepted either SHA1s or heads/tags that have been read. This
meant the user could not, e.g., enter HEAD to go back to the current
commit.
This adds code to call out to git rev-parse --verify if all other
methods of interpreting the string the user entered fail.
(git-rev-parse alone is not enough as we really want a single
revision.)
The error paths change slighly, because we now know from the rev-parse
invocation whether the expression was valid at all. The previous
"unknown" path is now only triggered if the revision does exist, but
is not in the current view display.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | diff | blob | history |