Re: [PATCH v8 4/4] git-rebase: add keep_empty flag
- From
Neil Horman <nhorman@tuxdriver.com>
- Date
- Apr 25, 2012, 10:38 UTC
- Message-ID
- <20120425103828.GA18895@hmsreliant.think-freely.org>
- In-Reply-To
- <xmqqipgoeewl.fsf@junio.mtv.corp.google.com>
On Tue, Apr 24, 2012 at 06:50:26PM -0700, Junio C Hamano wrote:
Show 29 quoted lines
> Neil Horman <nhorman@tuxdriver.com> writes:
>
> > Add a command line switch to git-rebase to allow a user the ability to specify
> > that they want to keep any commits in a series that are empty.
> > ...
> > diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> > index 5812222..ef263e0 100644
> > --- a/git-rebase--interactive.sh
> > +++ b/git-rebase--interactive.sh
> > @@ -167,6 +167,15 @@ has_action () {
> > sane_grep '^[^#]' "$1" >/dev/null
> > }
> >
> > +is_empty_commit() {
> > + tree=$(git rev-parse -q --verify "$1"^{tree} 2>/dev/null ||
> > + die "$1: not a commit that can be picked")
> > + ptree=$(git rev-parse -q --verify "$1"^^{tree} 2>/dev/null ||
> > + ptree=4b825dc642cb6eb9a060e54bf8d69288fbee4904)
> > +
> > + return test "$tree" = "$ptree"
> > +}
>
> I've amended the above and removed "return " from the last line.
>
> The series is now in 'next', so if we need further enhancement or fixup,
> they need to come as incremental updates, not as replacements.
>
> Thanks.
> Fastastic, thank you! Neil