git-gui icon indicating copy to clipboard operation
git-gui copied to clipboard

[Idea] Add a commit menu option to allow all the env vars to be adjusted?

Open PhilipOakley opened this issue 3 years ago • 1 comments

I wanted to create an initial commit to a new repo that was backdated, and had many of the classic environment variables (committer & author name, date, and perhaps --allow-empty, --orphan, etc) adjusted. This feels like this need a moderately common tasks where hindsight [foresight] would have been a great thing.

I thought it worth logging the Idea that the GUI should have, within the Commit menu dropdown, an "All options Commit" dialog. Food for thought anyway (I'll just have to use the command line in the mean time)

PhilipOakley avatar Oct 05 '20 09:10 PhilipOakley

An option to select common arguments, or set environment variables per-commit, would be really great! Other than basic actions like changing name & date (where I strongly disagree with default behavior of --amend, which keeps the Author and replaces Committer, as I usually want to override either both of them, or neither of them), an example use-case may be disabling Husky pre-commit hooks when creating a quick WIP draft commit before cherry-picking, switching, or resetting between others before creating a "real" commit. I'd be okay with either a textbox to write additional arguments, a configurable check-box, or even an option to set ENV variable; which right now isn't possible even using Tools, as an attempt to set an ENV globally via new command doesn't affect the commit.

  • On an unrelated note, even something as simple as wanting to keep an existing committer date (to be the same as author date) when amending a commit has to be done using something as crazy as git filter-branch --env-filter 'export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"' $REVISION^1..HEAD && git update-ref -d refs/original/refs/heads/$(git rev-parse --abbrev-ref HEAD), which I've had to add within Tools for a daily usage (named it "Update Committer Date (Since $REVISION)").

scscgit avatar Dec 07 '20 13:12 scscgit