Subject: Re: [PATCH/RFC 02/10] Teach rebase interactive the reset command

From: Jörg Sommer <[email-masked]>
Date: Sat, 12 Apr 2008 11:37:44 +0200

Hi Junio,

Junio C Hamano schrieb am Fri 11. Apr, 16:56 (-0700):
> Jörg Sommer <[email-masked]> writes:
> 
> > ---
> >  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

> > +			die "Invalid parent '$sha1' in $command $sha1 $rest"
> > +		output git reset --hard $tmp
> 
> Could this step fail, and if it does what should happen?

I don't expect it. tmp is a valid sha1 and reset may fail if the working
directory is dirty, but then the previous command should have failed,
too. Do you think different?

> > @@ -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."

Does this mean pick, edit and squash should understand marks, too? But
how useful is this? You can only set a mark if you've picked a commit and
using this commit again, e.g. pick it twice, doesn't sound useful.

-- 
$ cat /dev/random
#!/usr/bin/perl -WT
print "hello world\n";