Ramkumar Ramachandra <[email protected]> writes:
> 'git rebase' does not recognize revisions specified as :/text. This
> is because the attempts to rev-parse ${REV}^0, which fails in this
> case. Add a test to document this failure.
> - The failure occurs in git-rebase.sh:403. Is it using the ^0 only
> to make sure that the revision specified is a commit? Surely,
> there'a a better way to do this?
>
> Can someone point me in the right direction?
How about ${REV}^0 into
nREV=$(git rev-parse "${REV}")^0
and use it where you need an object name that needs to be parsed by
get_sha1(), e.g.
git checkout -q "$nREV^0"
I would suggest a helper function in git-sh-setup, something like:
peel_committish () {
case "$1" in
:/*)
peeltmp=$(git rev-parse --verify "$1") &&
git rev-parse --verify "$peeltmp^0"
;;
*)
git rev-parse --verify "$1^0"
;;
esac
}
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html