chshersh / zbg

✨ Zero Bullshit Git
Mozilla Public License 2.0
187 stars 11 forks source link

New Command: `zbg amend` #23

Open apainintheneck opened 1 year ago

apainintheneck commented 1 year ago

I'm wondering if this would be worth adding. I know that I tend to use git commit --amend a lot when working on projects if my commits tend to be related somehow before pushing to some remote branch. This is somewhat destructive because it changes the previous commit but in that case we could just hide it behind a prompt if we're worried about that.

chshersh commented 1 year ago

Sounds like a good idea! I do occasionally use --amend as well.

From my experience of using this command, the following works nicely and I'd happily merge a PR that adds the following as zbg amend:

git commit --amend --no-edit --date=now
apainintheneck commented 1 year ago

I guess I'd prefer to omit the --no-edit flag though I don't really feel that strongly either way. I use git commit --amend with and without that flag right now but I think I'd prefer to have a more verbose default in this case.

chshersh commented 1 year ago

@apainintheneck That sounds like a reasonable default to me, so I'm happy to accept this new command as a PR 🙂