git-filter-repo icon indicating copy to clipboard operation
git-filter-repo copied to clipboard

args: allow to use multiple `--refs` arguments

Open nslsrv opened this issue 2 years ago • 2 comments

Refs arguments are passed to git rev-list allowing user to configure the set of commits to operate on. IMHO it's important to be able to pass through any desirable rev-list configurations. This often requires using multiple --refs arguments.

Examples:

  • git filter-repo --refs head1 --refs head2
  • git filter-repo --refs='--glob:refs/heads/*' --refs='--glob:refs/tags/*'
  • git filter-repo --refs='--glob:refs/heads/*' --refs='--not' --refs='master

nslsrv avatar Dec 13 '23 02:12 nslsrv

@newren Hi, could you please review this one when you have some free time? This patch is good for cases when you need to rewrite ref history partially.

nslsrv avatar Mar 31 '24 17:03 nslsrv

Sorry for the delay.

The PR is interesting, but it is going to break people that have already been passing multiple refs like so:

   git filter-repo --refs head1 head2

or

   git filter-repo --refs ^master head1 head2

This would also invalidate part of the documentation, and would cause one of the tests in the regression testsuite to fail. This might make sense as an alternative way to have done things from the beginning, but I don't like breaking existing uses.

newren avatar Jul 07 '24 00:07 newren