-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Append a commit or rewrite all commits ? #54
Comments
Maybe inject black fixup commits in between user-created ones? This way the user could attempt to squash related things fairly easily if they want it... P.S. I also do not like wholesale commits like this |
I like this idea, this would allow a clear PR where you can check the diff, and then the repo owner would be resposible for the (madness of) rewriting the whole history. But is there a way to fixup that wouldn't create rebase conflicts ? Not sure. I was already surprised that |
You can try injecting two commits, not one. Fixup + its revert. This would probably simplify the interactive rebase part. Then, you could squash those reverts with the following commits... But yes, you are right. It's not exactly trivial. I'm currently helping out with packaging of pygit2 wheels so hopefully it will be possible to get those easily installable soon. It's interface should simplify plumbing level Git interactions... |
Hmm, it's interesting but the I'll need an example: There's 2 possible todo here:
but you'd have to manually enter B's commit message at the reword step, or
But, again, you'd have to enter B's commit message at the squash step. And non of those solutions can be achieved using Except if I'm mistaken ? |
(disclamer: rewriting history of merged commits is bad, I know, just exploring the idea for the sake of it)
In the one hand, rewriting history is bad. But in the other a huge big bang commit is equally bad for being able to use
git blame
and understanding where a commit comes from.So I would find it interesting to be able to retrospectively blacken all commits in git history one by one in a PR. Or if you're YOLO, for the whole repo.
For the whole repo, this can be done with
git filter-branch --tree-filter "git ls-files |xargs black" -- --all
. (it a similar construct for a single PR with something instead of--all
, probably<target-branch>..<pr-branch>
but I haven't tried). But in real life you don't want to rewrite history of your whole repo, that would be bad.This would mean the bot would rewrite commits but as far as I can tell, git filter-tree doesn't change the committer, so it wouldn't appear as co-author (we could add a Co-Authored-By` field, though). But, quite logically, this removes GPG signature from commits and tags. And rewriting the whole repo is madness, did I mention it ? Would be cool still. 🙃
The text was updated successfully, but these errors were encountered: