[user] name = Karl Fogel email = kfogel@red-bean.com [core] pager = /bin/cat excludesfile = /home/kfogel/.gitignore [init] defaultBranch = main [format] pretty = fuller [status] short = true [diff] noprefix = true # FWIW, this diff.renameLimit was motivated by a warning I got # when doing 'git log --name-status' on the 'feature-sharing' # branch of git@github.com:hmis-tools/hmis-api-server.git from # commit bc0f1e2ef, with git 2.9.3: # # warning: inexact rename detection was skipped due to too many files. # warning: you may want to set your diff.renameLimit variable to at least 2074 and retry the command. renameLimit = 2074 [branch] autosetupmerge = true [push] default = matching [pull] # On 2020-06-18 I suddenly started getting this new message # when I did 'git pull'. That's why I added this setting. # # $ pwd # $ ~/private/work/ots/clients/red-cross/dcsops/r/arcdata-wiki # $ git pull # # warning: Pulling without specifying how to reconcile # divergent branches is discouraged. You can squelch this # message by running one of the following commands sometime # before your next pull: # # git config pull.rebase false # merge (the default strategy) # git config pull.rebase true # rebase # git config pull.ff only # fast-forward only # # You can replace "git config" with "git config --global" to # set a default preference for all repositories. You can # also pass --rebase, --no-rebase, or --ff-only on the # command line to override the configured default per # invocation. # $ # # For more context, see https://www.reddit.com/r/git/comments/\ # h7kv0y/git_2270_starts_yelling_during_pull/ . ff = only [rerere] enabled = 1 # Three 'fsckObject' settings are recommended in this thread... # # https://groups.google.com/forum/#!topic/binary-transparency/f-BI4o8HZW0 # From: Eric Myhre # Subject: git integrity # To: binary-transparency (Google Group) # Message-ID: <56ABBA5B.6020703@exultant.us> # Date: Fri, 29 Jan 2016 11:15:39 -0800 # # ...however, it turns out that just setting transfer.fsckObjects is # enough, as the other two default to that. See Paul Eggert's post # https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg01807.html. # # See also bug reports mentioned by DKG in the "git integrity" thread: # # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813157 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=743227 # # (See https://github.com/robbyrussell/oh-my-zsh/issues/4963 for # discussion of an error that this setting can cause due to some # gotchas in some repositories' git histories, though.) [transfer] fsckObjects = true # But, for some repositories, not mentioning any names (cough, # kfogel@git.sv.gnu.org:/srv/git/emacs/elpa.git, cough), we then have # to ignore one of the fsck messages. See these threads for details: # # https://github.com/robbyrussell/oh-my-zsh/issues/4963 # https://github.com/holman/dotfiles/issues/231 # http://thread.gmane.org/gmane.comp.version-control.git/288336 # # Oh, but wait, it doesn't work anyway. So we'll comment it out, and # when checking out GNU ELPA, we'll comment out the above setting too. # # [fsck] # zeroPaddedFilemode = ignore [alias] # See https://news.ycombinator.com/item?id=4131460, which points to # http://blog.kfish.org/2010/04/git-lola.html. lol = log --graph --decorate --oneline lola = log --graph --decorate --oneline --all # The 'git edit' alias. # --------------------- # # https://gist.github.com/slifty/68bd451896f6494b870280c00dc4fe9c # https://chat.opentechstrategies.com/#narrow/stream/2-general/topic/some.20git.20magic/near/108695 # # ## How it works # # The alias does the following... # # 1. Populate a critical status tracking variable (this is used to make # sure the stash is kept consistent) # # $ EDITED_STASH=0 # # 2. Start an interactive rebase to the specified commit, replacing # `pick` with `edit` for the first line (i.e. specifying `edit` for # the passed in commit hash). # # $ GIT_SEQUENCE_EDITOR=\"sed -i '1s/^pick/edit/'\" git rebase -i "$1" # # 2. Remove the staged commit content # # $ git reset HEAD~1 # # 3. Mark all new files as being intended to commit (this allows you to # selectively include only a portion of the new file.) # # $ git add -AN # # 4. Perform a patch add against the original commit content. This is # where you can decide what NOT to include. # # $ git add -p # # 5. Perform the commit with only the patch edited changes, using the # original commit message (and allowing you to edit that message). # # $ git commit -e -C HEAD@{1} # # 6. Check to see if there is anything sitting around NOT staged for # commit (check to see if an edit actually happened) # # $ if [ -z \"$(git status --porcelain)\" ]; # # 7. If there were no changes (if git status --porcelain returned `""`), # then continue the rebase. # # $ then git rebase --continue; # # 8. Otherwise there are changes left over which have been edited out of # the commit. We need to: # # * Stage all of those changes. # # $ else git add -A # # * Stash those changes (and denote that we have stashed) # # $ git stash -q && EDITED_STASH=1 # # * Invoke the rebase # # $ git rebase --continue # # * Pop the changes into our working directory # (and register that the stash is clean) # # $ git stash pop --quiet && EDITED_STASH=0 # # * Unstage the changes # # $ git reset; # # # 9. And finally, if anything goes wrong at any step of the way, we want # to abort the rebase and clean up any lingering git cache and stash # changes, as if none of this ever happened. # # $ (echo 'Aborting the edit...' && if [ \"$EDITED_STASH\" = \"1\" ]; then git stash drop -q; fi && git rebase --abort && git add -A && git reset); }; f" # # ## Some notes # # * It isn't currently possible to edit away a deleted file, though it # *is* possible to edit away an added file. # # * If you remove *all* changes from a commit the edit will be # aborted. # # * If your edits cause a later merge conflict (for instance if you # remove a file from a commit that is edited later in your rebase) # then the edit will be aborted. # # * If you ctrl-C out of the git add patch view, the alias will stop # short (and you will need to manually type `git rebase --abort`. edit = !"f() { EDITED_STASH=0 && GIT_SEQUENCE_EDITOR=\"sed -i '1s/^pick/edit/'\" git rebase -i \"$1~\" && git reset HEAD~1 && git add -AN && git add -p && git commit -e -C HEAD@{1} && if [ -z \"$(git status --porcelain)\" ]; then git rebase --continue; else git add -A && git stash -q && EDITED_STASH=1 && git rebase --continue && git stash pop -q && EDITED_STASH=0 && git reset; fi || (echo 'Aborting the edit...' && if [ \"$EDITED_STASH\" = \"1\" ]; then git stash drop -q; fi && git rebase --abort && git add -A && git reset); }; f"