git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[BUG] Git 2.20: `git help -a' hangs if specific git alias occurs

From
Sebastian Gniazdowski <sgniazdowski@gmail.com>
Date
Dec 11, 2018, 17:30 UTC
Message-ID
<CAKc7PVAzSOknfmy7p09zF4LOi4t66CBmd27ZuQ39_wKYWSiiUA@mail.gmail.com>

Hello, I've attached a screenshot for running `git help -a' that ends in a hang and ~100% cpu usage, for the following ~/.gitconfig (it's also attached):

https://raw.githubusercontent.com/agostonbarna/dotfiles-base/master/.gitconfig

So it's hangs on the alias `remote-origin-https-to-ssh'. One user in following thread discovered, that it's about lenght of the alias: "abcdefghijklmnopqr = ... is ok, but with abcdefghijklmnopqrs = ..." it will crash, "the problem occurs if the name of a git alias consists of more than 18 characters" (see the thread: https://github.com/zdharma/fast-syntax-highlighting/issues/95).

Is there a workaround? Of course a fix is needed, but I'm interested specifically in a workaround so my Zsh plugin `fast-syntax-highlighting' can work without hang also with Git 2.20, without exceptions in code.

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org


[include]
  path = ~/.gitconfig.user

#[user]
  #useconfigOnly = true # enforces to configure Git user on a per-repository basis

[credential]
  helper = cache --timeout=3600

[core]
  trustctime = false
  preComposeUnicode = false
  autocrlf = input
  eol = lf
  untrackedCache = true # speed up commands involving untracked files
  #attributesFile = ~/.gitattributes
  #excludesfile = ~/.gitignore
  #filemode = false
  #editor = vim

[color]
  ui = auto

[color "branch"]
  current = yellow reverse
  local = yellow
  remote = green

[color "status"]
  added = green
  changed = yellow
  deleted = red
  untracked = cyan
  header = normal italic
  localBranch = cyan bold
  remoteBranch = magenta bold

[color "diff"]
  meta = yellow bold
  frag = cyan
  new = green # additions
  old = red # deletions
  newMoved = green dim
  oldMoved = red dim
  whitespace = red reverse
  commit = yellow bold

[color "diff-highlight"]
  oldNormal = red bold
  oldHighlight = black red
  newNormal = green bold
  newHighlight = black green

[color "grep"]
  linenumber = yellow bold
  match = red bold
  filename = magenta

[advice]
  statusHints = false

[status]
  showStash = true

[grep]
  extendRegexp = true
  lineNumber = true

[commit]
  template = ~/.gitmessage

[stash]
  showPatch = true

[apply]
  whitespace = fix  # Detect whitespace errors when applying a patch

[push]
  default = simple

[pull]
  ff = only

[rebase]
  autoStash = true

[diff]
  renames = copies
  colorMoved = zebra
  tool = meld
  #tool = idea # slow
  #whitespace = reverse
  #context = 0

[difftool]
  prompt = false

[difftool "meld"]
  cmd = meld \"$LOCAL\" \"$REMOTE\" -L \"LOCAL | REMOTE\" 2>/dev/null
  trustExitCode = true

[difftool "idea"]
  cmd = idea diff \"$LOCAL\" \"$REMOTE\"

[diff-so-fancy]
  useUnicodeRuler = false

[merge]
  conflictstyle = diff3
  tool = meld
  #tool = idea

[mergetool]
  prompt = false
  #keepBackup = false # do not keep the .orig backup files

[mergetool "meld"]
  cmd = meld \"$LOCAL\" \"$MERGED\" \"$REMOTE\" -o \"$MERGED\" -L \"LOCAL | MERGED | REMOTE\" 2>/dev/null
  #cmd = meld \"$LOCAL\" \"$BASE\" \"$REMOTE\" -o \"$MERGED\" -L \"LOCAL | BASE | REMOTE\" 2>/dev/null
  trustExitCode = true

[mergetool "idea"]
  cmd = idea merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
  trustExitCode = true

[interactive]
  singleKey = true # in interactive mode, accept one-letter inputs (no need to hit enter)

[submodule]
  fetchJobs = 0 # 0: auto, 1: default

[tag]
  sort = version:refname # sort tags by version number (1.2.0 before 1.10.2)

[alias]
  aliases = config --get-regexp "^alias\\."
  alias = "!git config --get-regexp \"^alias\\.$1$\" #"

  addu = add -u
  addp = add -p
  addi = add -i
  addn = add -n
  addN = add -N

  st = status -sb

  co = checkout
  cob = checkout -b
  cof = checkout -f

  stashk = stash save --keep-index
  stashl = stash list
  stashps = stash push

  ps = push
  psf = push --force-with-lease
  psuom = push -u origin master

  pullf = pull --allow-unrelated-histories

  br = branch
  brd = branch -d
  brD = branch -D
  brm = branch -m
  branches = branch -vv
  remotes = remote -v
  tags = tag -l
  untracked = ls-files --exclude-standard --others --directory --no-empty-directory
  ignored = ls-files --exclude-standard --others --ignored --directory
  modified = ls-files --exclude-standard --modified
  deleted = ls-files --exclude-standard --deleted

  ci = commit -v
  cia = commit -v -a
  cim = commit -m
  ciam = commit -v -a -m
  cinit = commit -m 'Initial commit' --allow-empty
  amend = commit --amend --no-edit
  amenda = commit --amend --no-edit -a
  amende = commit --amend

  # View abbreviated SHA, description, and history graph of the latest 20 commits
  lg = log --graph --pretty=format:'%C(red)%h%C(reset) %C(bold)%s%C(reset) %C(green)(%cr)%C(reset) %C(blue)%an%C(reset)%C(yellow)%d%C(reset)'
  lga = !git lg --all
  lgp = log -p --ignore-all-space --date=relative
  lgpf = !git lgp --follow

  standup = "!git log --stat --no-merges --since=$(($(date +%u)==1?3:1)).days.ago.midnight --date=format:'%Y-%m-%d %H:%M:%S' --pretty=format:'%C(red)%h%C(reset) %C(bold)%s%C(reset) %C(green)%cd%C(reset)'"

  # Show what I did today
  today = "!git log --reverse --no-merges --branches=* --date=local --after=\"yesterday 23:59\" --author=\"`git config --get user.name`\""

  showw = show --color-words
  showc = show --color-words=.
  showst = show --stat

  # word diff
  diffw = diff --color-words #-U0 -b -w --ignore-space-at-eol --ignore-blank-lines

  # character diff
  diffc = diff --color-words=.

  diffs = diff --staged
  diffsw = diff --staged --color-words
  diffsc = diff --staged --color-words=.
  diffst = diff --stat

  dt = difftool

  mt = mergetool

  rao = remote add origin

  unstage = reset
  rh = reset --hard
  rs = reset --soft
  rs1 = reset --soft @^

  rb = rebase
  rbi = rebase -i
  rba = rebase --abort
  rbc = rebase --continue

  ls = ls-files

  ag = "grep --break --heading --line-number"

  # Search files registered in the index, rather than the working tree
  ag-index = "grep --break --heading --line-number --cached -e"

  # Local Git Server
  # Appending "#" to an alias allow positional parameters without leaving the trailing ones
  # Origin: git serve REPO
  # Destination: git pull git://IP_OR_HOSTNAME_OF_ORIGIN/
  server = "!git daemon --verbose --reuseaddr --export-all --enable=receive-pack --base-path=\"$1\" #"

  remote-origin-https-to-ssh = "!git remote set-url origin $(git remote get-url origin | sed 's|.*://|git@|; s|/|:|')"

  assume-unchanged = update-index --assume-unchanged
  assume-changed = update-index --no-assume-unchanged

[url "git@github.com:"]
  #insteadOf = "https://github.com/" # force SSH instead of HTTP
  insteadOf = "github:" # shortcut
  pushInsteadOf = "git://github.com/"
  pushInsteadOf = "https://github.com/"

[url "git@gitlab.com:"]
  #insteadOf = "https://gitlab.com/" # force SSH instead of HTTP
  insteadOf = "gitlab:" # shortcut
  pushInsteadOf = "git://gitlab.com/"
  pushInsteadOf = "https://gitlab.com/"

[url "git@bitbucket.org:"]
  #insteadOf = "https://bitbucket.org/" # force SSH instead of HTTP
  insteadOf = "bitbucket:" # shortcut
  pushInsteadOf = "git://bitbucket.org/"
  pushInsteadOf = "https://bitbucket.org/"

[url "git@heroku.com:"]
  insteadOf = "heroku:" # shortcut

# Prettier inline JSON diff
[diff "json"]
  textconv = "perl -MJSON::PP -e '$j = JSON::PP->new->pretty->canonical; print $j->encode($j->decode(do {$/ = undef; <>}))'"
  cachetextconv = true

[filter "transmission-conf"]
  clean = "grep -Ev '\"(alt-speed-enabled|blocklist-date|main-window-[-a-z]+|open-dialog-dir|rpc-password)\":'"
  smudge = cat

#[diff "bin"]
#  textconv = hexdump -v -C

# Merge drivers
# .gitattributes example: file merge=ours
[merge "theirs"]
  driver = cp -f %B %A

[merge "ours"]
  driver = true
Next: Duy Nguyen
Message 1 of 3 in “[BUG] Git 2.20: `git help -a' hangs if specific git alias occurs”
  1. Sebastian GniazdowskiDec 11, 2018
  2. Duy NguyenDec 11, 2018
  3. SZEDER GáborDec 11, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.