elixirsc / git-pair

Automatically adds `Co-authored-by` mark when you're pairing
https://hex.pm/packages/git_pair
MIT License
8 stars 0 forks source link

Detect the user attempt to commit with amend #38

Open amadeu01 opened 4 years ago

amadeu01 commented 4 years ago

If a user attempts to commit with --amend flag, it will duplicate the co-authored-by. What is the expected behaviour for this? Should we clean all the current authors, if any? Or, just ignore?

Below some suggestion for simply ignore amends ⤵️

IS_AMEND=$(ps -ocommand= -p $PPID | grep -e '--amend');

if [ -n "$IS_AMEND" ]; then
  return;
fi
amadeu01 commented 4 years ago