Skip to content
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

git fixdown #1

Open
mnieber opened this issue Feb 22, 2018 · 3 comments
Open

git fixdown #1

mnieber opened this issue Feb 22, 2018 · 3 comments

Comments

@mnieber
Copy link

mnieber commented Feb 22, 2018

Hi Chris, fyi, I used your git-autofix script as the basis for a variation:

https://gist.github.com/mnieber/b88a2f3136aa1f733d96314507935c8d

This variation will abort if there are multiple possible target commits for the fixup (making it possible to "blindly" fixup without worrying about accidentically fixing up the wrong commit).

There is a feature upcoming where - in case of multiple possible target commits - I will also print which lines must be unstaged to remove the conflict.

@chrisarcand
Copy link
Owner

That's a great idea! I have run in to that situation before so something smarter would definitely be nice.

I like Python but prefer to keep as much of my dotfiles in plain ol' Bash as much as possible; maybe I'll see if I can recreate that in my own version :)

Thanks so much for sharing!

@mnieber
Copy link
Author

mnieber commented Feb 22, 2018

Ah, yes, if you could adapt your bash script, that would be nice :-) (it would be more portable)

@mnieber
Copy link
Author

mnieber commented Feb 23, 2018

By the way, I improved the script a little:

  • the --force argument forces the creation of a fixup commit when there are multiple possible target commits (picking the most recent commit)

  • the --verbose argument prints extra information about the changed lines when there are multiple possible target commits. This allows you to check if it's still okay to make a fixup with these changes (e.g. using --force)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants