Skip to content

Instantly share code, notes, and snippets.

@jasonsparc
Last active October 1, 2023 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonsparc/736ef0e0bcac7025addf8a4ac3e1cc16 to your computer and use it in GitHub Desktop.
Save jasonsparc/736ef0e0bcac7025addf8a4ac3e1cc16 to your computer and use it in GitHub Desktop.
`git-cheat-reword` – Authentic rewords ( ͡° ͜ʖ ͡°)
#!/bin/bash
# Usage: git cheat-reword
git rev-parse || exit $?
if [[ $1 == "-q" ]]; then
if_quiet="-q"; shift
else
echo "Rewording... (with author date as committer date)"
fi
# Stash if the index contains uncommitted changes.
if ! git diff-index --cached --quiet HEAD --ignore-submodules --; then
git stash $if_quiet
did_stash=1
fi
export GIT_COMMITTER_DATE="$(git log -1 --date="iso" --format="%ad")"
git commit $if_quiet --amend --date="$GIT_COMMITTER_DATE"
if [[ $did_stash = 1 ]]; then
git stash pop --index $if_quiet
fi
@jasonsparc
Copy link
Author

@BlackburnUTG
Copy link

any plans for ahk2.0 version?)

@jasonsparc
Copy link
Author

@BlackburnUTG I don't know about what you mean. The above is for bash.

Perhaps you accidentally commented on the wrong gist?

@BlackburnUTG
Copy link

@BlackburnUTG I don't know about what you mean. The above is for bash.

Perhaps you accidentally commented on the wrong gist?

oh, yeah.. sorry.
I was tried to ask in your "AutoHotkey, Accelerated Scrolling v1.3, By BoffinbraiN" topic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment