From: Junio C Hamano <gitster@pobox•com>
To: Charles Bailey <charles@hashpling•org>
Cc: git@vger•kernel.org
Subject: Re: [PATCH] Fix filter-branch to eliminate duplicate mapped parents
Date: Tue, 01 Jul 2014 08:03:46 -0700 [thread overview]
Message-ID: <xmqqmwctxgrx.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1404163227-30962-1-git-send-email-charles@hashpling.org> (Charles Bailey's message of "Mon, 30 Jun 2014 22:20:27 +0100")
Charles Bailey <charles@hashpling•org> writes:
> I worked on this after discovering that --prune-empty often left some
> apparently empty commits that I was wasn't expecting it to leave and
> that running filter-branch --prune-empty in a loop would often do many
> passes where it was still pruning empty former merge commits.
Good find.
>
> The test is a simple example of such a case. A non-ff merge of a commit
> that only changes a file that is to be pruned gets squashed into an
> empty non-merge commit that should be pruned.
>
> git-filter-branch.sh | 8 +++++++-
> t/t7003-filter-branch.sh | 11 +++++++++++
> 2 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/git-filter-branch.sh b/git-filter-branch.sh
> index 86d6994..c5b82a8 100755
> --- a/git-filter-branch.sh
> +++ b/git-filter-branch.sh
> @@ -332,7 +332,13 @@ while read commit parents; do
> parentstr=
> for parent in $parents; do
> for reparent in $(map "$parent"); do
> - parentstr="$parentstr -p $reparent"
> + case "$parentstr" in
> + *" -p $reparent"*)
> + ;;
> + *)
> + parentstr="$parentstr -p $reparent"
> + ;;
> + esac
The case arms seem to be indented one level too deep; I'll fix it up
locally when queuing, so no need to resend.
Thanks.
prev parent reply other threads:[~2014-07-01 15:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-30 21:20 [PATCH] Fix filter-branch to eliminate duplicate mapped parents Charles Bailey
2014-07-01 12:11 ` Charles Bailey
2014-07-01 15:03 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqmwctxgrx.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=charles@hashpling$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox