All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <J.Sixt@eudaptics.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] filter-branch: rewrite only refs which were not excluded  bythe options
Date: Tue, 24 Jul 2007 13:23:34 +0200	[thread overview]
Message-ID: <46A5E136.D413D3B7@eudaptics.com> (raw)
In-Reply-To: Pine.LNX.4.64.0707241205480.14781@racer.site

Johannes Schindelin wrote:
> So really exclude excluded refs from being rewritten.  This also allows
> you to safely call
> 
>         git filter-branch <some-filter> --all <rev-list options>
> 
> to rewrite _all_ branches and tags.

BTW, '--all' in the argument list of filter-branch works only if it is
preceded by '--':

	git filter-branch <some-filter> -- --all <rev-list options>

> @@ -181,6 +181,7 @@ export GIT_DIR GIT_WORK_TREE=.
> 
>  # These refs should be updated if their heads were rewritten
> 
> +negatives="$(git rev-parse --revs-only "$@" | grep "^\^")"
>  git rev-parse --revs-only --symbolic "$@" |
>  while read ref
>  do
> @@ -196,7 +197,13 @@ do
>                         grep "refs/\(tags\|heads\)/$ref$")"
>         esac
> 
> -       git check-ref-format "$ref" && echo "$ref"
> +       # make sure we have a valid ref
> +       git check-ref-format "$ref" || continue
> +
> +       # if the ref has been excluded by the other options, skip it
> +       test -z "$(git rev-list -1 "$ref" $negatives)" && continue

Does this catch my use-case with --since? I think not, because:

$ git rev-parse --revs-only --since=2007.01.01 master topic
--max-age=1167606000
257061f3323dc0162f731d934f0870e919211fdf
3405729b94a654df8afbb9a1e13a4cf49a1c351c

There are no negatives. Does it help to filter the non-positives?

negatives=$(git rev-parse --revs-only "$@" | egrep -v '^[0-9a-f]{40}$')

(Except the the '{40}' part is not portable. Hmpf.)

-- Hannes

  reply	other threads:[~2007-07-24 11:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-23 17:34 [PATCH] filter-branch: Big syntax change; support rewriting multiple refs Johannes Schindelin
2007-07-24  5:35 ` Junio C Hamano
2007-07-24  9:10   ` Johannes Schindelin
2007-07-24  9:27 ` [PATCH] filter-branch: Big syntax change; support rewriting multiplerefs Johannes Sixt
2007-07-24 10:36   ` [PATCH] filter-branch: when dwim'ing a ref, only allow heads and tags Johannes Schindelin
2007-07-24 11:04     ` [PATCH] filter-branch: when dwim'ing a ref, only allow heads andtags Johannes Sixt
2007-07-24 11:20       ` Johannes Schindelin
2007-07-24 11:27         ` [PATCH] filter-branch: when dwim'ing a ref, only allow heads and tags Johannes Schindelin
2007-07-24 11:06   ` [PATCH] filter-branch: rewrite only refs which were not excluded by the options Johannes Schindelin
2007-07-24 11:23     ` Johannes Sixt [this message]
2007-07-24 11:33       ` [PATCH] filter-branch: rewrite only refs which were not excluded bythe options Johannes Schindelin
2007-07-24 13:32         ` [PATCH] filter-branch: rewrite only refs which were not excludedbythe options Johannes Sixt
2007-07-24 13:41           ` Johannes Schindelin
2007-07-24 14:08             ` Johannes Sixt
2007-07-24 14:21               ` Johannes Schindelin
2007-07-24 15:03                 ` Johannes Sixt
2007-07-24 19:52                   ` Johannes Schindelin
2007-07-24 13:42           ` [REVISED PATCH] filter-branch: rewrite only unexcluded refs Johannes Schindelin
2007-07-24 13:33         ` [PATCH] filter-branch: rewrite only refs which were not excludedbythe options Johannes Sixt
2007-07-24 13:46           ` Johannes Schindelin

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=46A5E136.D413D3B7@eudaptics.com \
    --to=j.sixt@eudaptics.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.