Re: [PATCH v8 4/4] git-rebase: add keep_empty flag
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 25, 2012, 01:50 UTC
- Message-ID
- <xmqqipgoeewl.fsf@junio.mtv.corp.google.com>
- In-Reply-To
- <1334932577-31232-5-git-send-email-nhorman@tuxdriver.com>
Neil Horman <nhorman@tuxdriver.com> writes:
Show 19 quoted lines
> 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.