Re: [PATCH/RFC 02/10] Teach rebase interactive the reset command
- From
Junio C Hamano <junio@pobox.com>
- Date
- Apr 11, 2008, 23:56 UTC
- Message-ID
- <7viqyondyn.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1207785521-27742-3-git-send-email-joerg@alea.gnuu.de>
Jörg Sommer <joerg@alea.gnuu.de> writes:
Show 15 quoted lines
> ---
> git-rebase--interactive.sh | 20 ++++++++++++++++++++
> t/t3404-rebase-interactive.sh | 10 ++++++++++
> 2 files changed, 30 insertions(+), 0 deletions(-)
>
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index b001ddf..7dac51b 100755
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -258,6 +258,16 @@ parse_mark() {
> return 1
> }
>
> +mark_to_sha1() {
> + local markBashism.
> + if mark=$(parse_mark $1) > + then > + cat "$MARKS"/$mark
This cat may become "rev-parse --verify" if we decide to move $MARKS underneath refs/ namespace somewhere.
Show 6 quoted lines
> + reset|r) > + comment_for_reflog reset > + > + mark_action_done > + tmp=$(mark_to_sha1 $sha1) || \ > + tmp=$(git rev-parse --verify $sha1) ||
and you then would not need to do the verify twice.
> + die "Invalid parent '$sha1' in $command $sha1 $rest" > + output git reset --hard $tmp
Could this step fail, and if it does what should happen?
Show 5 quoted lines
> @@ -569,6 +588,7 @@ do > # edit = use commit, but stop for amending > # squash = use commit, but meld into previous commit > # mark #NUM = mark the current HEAD for later reference > +# reset #NUM|commit = reset HEAD to a previous set mark or a commit
"to a previously set mark". But I would say upfront "in the todo insn whenever you need to refer to a commit, in addition to the usual commit object name, you can use '#num' syntax to refer to a commit previously marked with the 'mark' insn." and make this line just read:
# reset commit = reset HEAD to the commit