Open andry81 opened 1 year ago
I was certain I had already documented that --refs
doesn't take any hyphenated options (such as --not
), but it appears I didn't mention that anywhere. Oops.
Not a bug, though, it's just a somewhat natural consequence of the fact that python's argparse is going to attempt to parse all the hyphenated options, and if I wanted to make it work like git, then I'd have to specially treat double dashes and just let all the arguments be positional. I don't want to go that route. Besides, filter-repo is about scripting and folks can use git-for-each ref and git-rev-parse if they really need to...though I suspect that most attempts to be clever with --refs are more likely just misues of the tool (as per your other ticket).
Anyway, thanks for pointing out that I forgot to document this. We should mention that the things passed to --refs
cannot begin with a hyphen.
But this means that will be a challenge to convert git filter-branch
into git filter-repo
as a replacement. The git filter-branch
uses generic git rev-list
syntax, when you are not.
But this means that will be a challenge to convert
git filter-branch
intogit filter-repo
as a replacement. Thegit filter-branch
uses genericgit rev-list
syntax, when you are not.
git shortlog origin/next --branches --not origin/main
is equivalent to
git shortlog $(git rev-parse --symbolic origin/next --branches --not origin/main)
which is a pretty trivial conversion. If filter-repo was a command you used very frequently, I could understand possibly wanting to not need to do that conversion. However, since filter-branch and filter-repo are only supposed to be used once in a blue moon and only with special care, I don't think needing to convert like this is at all onerous. And if it discourages more people from using --refs, especially since that is often misused, all the better.
Found beside another issue: https://github.com/newren/git-filter-repo/issues/468
If use
--refs
as range parameter just like in thegit filter-branch
:git-filter-repo-replace-text.sh:
I know it has to be a bit corrected:
But nevertheless
--refs
is not completely compatible with thegit rev-list
format.