Re: The git spring cleanup challenge
From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-06-03 08:28:13
On Tue, Jun 01 2021, Felipe Contreras wrote:
1. Remove all the configuration that is not essential (just leave
user.name and user.email or equivalent)
2. Pick 2 configurations you think you can't live without. You are not
allowed to change them afterwards.
3. Every day you can add 1 additional configuration (and update it the
next day).
4. The moment you add a 4th configuration you lose.
This proposal is somewhere between picking which 2 of your 4 kids gets
to live and asking an alcoholic to stop drinking for a week just so he
can tell you at the end what his favorite drinks are :)
So I skipped the "disable most config", but for what it's worth I think
I'd miss these the most, I couldn't pick just N favorites, sorry:
* diff.colorMoved=true: super useful, but I'd be vary of turning it on
by default in its current form. E.g. on gcc.git's changelog files it
has really pathological performance characteristics.
* rebase.rescheduleFailedExec=true: Relatively new, but I'd find it
hard to live without this now.
* rerere.*: others have mentioned "should be enabled by default".
But on that topic I set gc.rerereResolved="1 year ago", with
managing/merging topics in git.git the default of 60 days is way too
aggressive.
* merge.defaultToUpstream: ditto other discussion, should be "true" by
default.
* checkout.defaultRemote=origin: I introduced this, so I'm biased, but
I find it super useful. Usually because I do "git branch -m
new-branch" on master to create topics, and then "git checkout
master" to get a master back (or use the existing one).
* commit.verbose=true: so you know what you're looking at in doing in
"git commit --amend".
* grep.patternType=perl: Another personal soap box (but really, BRE
anywhere sucks).
I also have a bunch of aliases that would not be useful to a general
audience, but which I find I can't live without, some of the most
commonly used ones:
# Log with "less" n/p already going to the next/prev commit
log-psfd = "!f() { PAGER=\"less -p'^commit'\" git log -p --stat --full-diff $@; }; f"
# cutesy commit aliases (I guess "commit" is both "ci" and "c" here, but...)
cif = commit --fixup
cis = commit --squash
ca = commit --amend
cane = commit --amend --no-edit
Similarly rebase is "r", "--interactive" is "ri", "--abort", and
"--continue" are "ra" and "rc".
If anyone's interested in the rest / full set:
https://github.com/avar/dotfiles/blob/master/.gitconfig