From: Junio C Hamano Date: Wed, 25 Apr 2012 01:50:26 GMT Subject: Re: [PATCH v8 4/4] git-rebase: add keep_empty flag Message-ID: In-Reply-To: <1334932577-31232-5-git-send-email-nhorman@tuxdriver.com> Neil Horman 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.