{"thread":{"id":"50009","subject":"[BUG] Git 2.20: `git help -a' hangs if specific git alias occurs","startedAt":"2018-12-11T17:30:43Z","lastAt":"2018-12-11T17:47:08Z","messageCount":3,"participants":["Sebastian Gniazdowski","Duy Nguyen","SZEDER Gábor"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"365105","messageId":"CAKc7PVAzSOknfmy7p09zF4LOi4t66CBmd27ZuQ39_wKYWSiiUA@mail.gmail.com","threadId":"50009","inReplyTo":null,"subject":"[BUG] Git 2.20: `git help -a' hangs if specific git alias occurs","fromName":"Sebastian Gniazdowski","fromEmail":"sgniazdowski@gmail.com","sentAt":"2018-12-11T17:30:26Z","receivedAt":"2018-12-11T17:30:43Z","isPatch":false,"sender":{"key":"sgniazdowski@gmail.com","avatar":"https://gravatar.com/avatar/4fe8402ad2382744749d089f9c26c9a9fd58c4265afcc0a945d2869cad528e39?d=mp&s=160"},"body":"Hello,\nI've attached a screenshot for running `git help -a' that ends in a\nhang and ~100% cpu usage, for the following ~/.gitconfig (it's also\nattached):\n\nhttps://raw.githubusercontent.com/agostonbarna/dotfiles-base/master/.gitconfig\n\nSo it's hangs on the alias `remote-origin-https-to-ssh'. One user in\nfollowing thread discovered, that it's about lenght of the alias:\n\"abcdefghijklmnopqr = ... is ok, but with abcdefghijklmnopqrs = ...\"\nit will crash, \"the problem occurs if the name of a git alias consists\nof more than 18 characters\" (see the thread:\nhttps://github.com/zdharma/fast-syntax-highlighting/issues/95).\n\nIs there a workaround? Of course a fix is needed, but I'm interested\nspecifically in a workaround so my Zsh plugin\n`fast-syntax-highlighting' can work without hang also with Git 2.20,\nwithout exceptions in code.\n-- \nSebastian Gniazdowski\nNews: https://twitter.com/ZdharmaI\nIRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin\nBlog: http://zdharma.org\n\n\n[include]\n  path = ~/.gitconfig.user\n\n#[user]\n  #useconfigOnly = true # enforces to configure Git user on a per-repository basis\n\n[credential]\n  helper = cache --timeout=3600\n\n[core]\n  trustctime = false\n  preComposeUnicode = false\n  autocrlf = input\n  eol = lf\n  untrackedCache = true # speed up commands involving untracked files\n  #attributesFile = ~/.gitattributes\n  #excludesfile = ~/.gitignore\n  #filemode = false\n  #editor = vim\n\n[color]\n  ui = auto\n\n[color \"branch\"]\n  current = yellow reverse\n  local = yellow\n  remote = green\n\n[color \"status\"]\n  added = green\n  changed = yellow\n  deleted = red\n  untracked = cyan\n  header = normal italic\n  localBranch = cyan bold\n  remoteBranch = magenta bold\n\n[color \"diff\"]\n  meta = yellow bold\n  frag = cyan\n  new = green # additions\n  old = red # deletions\n  newMoved = green dim\n  oldMoved = red dim\n  whitespace = red reverse\n  commit = yellow bold\n\n[color \"diff-highlight\"]\n  oldNormal = red bold\n  oldHighlight = black red\n  newNormal = green bold\n  newHighlight = black green\n\n[color \"grep\"]\n  linenumber = yellow bold\n  match = red bold\n  filename = magenta\n\n[advice]\n  statusHints = false\n\n[status]\n  showStash = true\n\n[grep]\n  extendRegexp = true\n  lineNumber = true\n\n[commit]\n  template = ~/.gitmessage\n\n[stash]\n  showPatch = true\n\n[apply]\n  whitespace = fix  # Detect whitespace errors when applying a patch\n\n[push]\n  default = simple\n\n[pull]\n  ff = only\n\n[rebase]\n  autoStash = true\n\n[diff]\n  renames = copies\n  colorMoved = zebra\n  tool = meld\n  #tool = idea # slow\n  #whitespace = reverse\n  #context = 0\n\n[difftool]\n  prompt = false\n\n[difftool \"meld\"]\n  cmd = meld \\\"$LOCAL\\\" \\\"$REMOTE\\\" -L \\\"LOCAL | REMOTE\\\" 2>/dev/null\n  trustExitCode = true\n\n[difftool \"idea\"]\n  cmd = idea diff \\\"$LOCAL\\\" \\\"$REMOTE\\\"\n\n[diff-so-fancy]\n  useUnicodeRuler = false\n\n[merge]\n  conflictstyle = diff3\n  tool = meld\n  #tool = idea\n\n[mergetool]\n  prompt = false\n  #keepBackup = false # do not keep the .orig backup files\n\n[mergetool \"meld\"]\n  cmd = meld \\\"$LOCAL\\\" \\\"$MERGED\\\" \\\"$REMOTE\\\" -o \\\"$MERGED\\\" -L \\\"LOCAL | MERGED | REMOTE\\\" 2>/dev/null\n  #cmd = meld \\\"$LOCAL\\\" \\\"$BASE\\\" \\\"$REMOTE\\\" -o \\\"$MERGED\\\" -L \\\"LOCAL | BASE | REMOTE\\\" 2>/dev/null\n  trustExitCode = true\n\n[mergetool \"idea\"]\n  cmd = idea merge \\\"$LOCAL\\\" \\\"$REMOTE\\\" \\\"$BASE\\\" \\\"$MERGED\\\"\n  trustExitCode = true\n\n[interactive]\n  singleKey = true # in interactive mode, accept one-letter inputs (no need to hit enter)\n\n[submodule]\n  fetchJobs = 0 # 0: auto, 1: default\n\n[tag]\n  sort = version:refname # sort tags by version number (1.2.0 before 1.10.2)\n\n[alias]\n  aliases = config --get-regexp \"^alias\\\\.\"\n  alias = \"!git config --get-regexp \\\"^alias\\\\.$1$\\\" #\"\n\n  addu = add -u\n  addp = add -p\n  addi = add -i\n  addn = add -n\n  addN = add -N\n\n  st = status -sb\n\n  co = checkout\n  cob = checkout -b\n  cof = checkout -f\n\n  stashk = stash save --keep-index\n  stashl = stash list\n  stashps = stash push\n\n  ps = push\n  psf = push --force-with-lease\n  psuom = push -u origin master\n\n  pullf = pull --allow-unrelated-histories\n\n  br = branch\n  brd = branch -d\n  brD = branch -D\n  brm = branch -m\n  branches = branch -vv\n  remotes = remote -v\n  tags = tag -l\n  untracked = ls-files --exclude-standard --others --directory --no-empty-directory\n  ignored = ls-files --exclude-standard --others --ignored --directory\n  modified = ls-files --exclude-standard --modified\n  deleted = ls-files --exclude-standard --deleted\n\n  ci = commit -v\n  cia = commit -v -a\n  cim = commit -m\n  ciam = commit -v -a -m\n  cinit = commit -m 'Initial commit' --allow-empty\n  amend = commit --amend --no-edit\n  amenda = commit --amend --no-edit -a\n  amende = commit --amend\n\n  # View abbreviated SHA, description, and history graph of the latest 20 commits\n  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)'\n  lga = !git lg --all\n  lgp = log -p --ignore-all-space --date=relative\n  lgpf = !git lgp --follow\n\n  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)'\"\n\n  # Show what I did today\n  today = \"!git log --reverse --no-merges --branches=* --date=local --after=\\\"yesterday 23:59\\\" --author=\\\"`git config --get user.name`\\\"\"\n\n  showw = show --color-words\n  showc = show --color-words=.\n  showst = show --stat\n\n  # word diff\n  diffw = diff --color-words #-U0 -b -w --ignore-space-at-eol --ignore-blank-lines\n\n  # character diff\n  diffc = diff --color-words=.\n\n  diffs = diff --staged\n  diffsw = diff --staged --color-words\n  diffsc = diff --staged --color-words=.\n  diffst = diff --stat\n\n  dt = difftool\n\n  mt = mergetool\n\n  rao = remote add origin\n\n  unstage = reset\n  rh = reset --hard\n  rs = reset --soft\n  rs1 = reset --soft @^\n\n  rb = rebase\n  rbi = rebase -i\n  rba = rebase --abort\n  rbc = rebase --continue\n\n  ls = ls-files\n\n  ag = \"grep --break --heading --line-number\"\n\n  # Search files registered in the index, rather than the working tree\n  ag-index = \"grep --break --heading --line-number --cached -e\"\n\n  # Local Git Server\n  # Appending \"#\" to an alias allow positional parameters without leaving the trailing ones\n  # Origin: git serve REPO\n  # Destination: git pull git://IP_OR_HOSTNAME_OF_ORIGIN/\n  server = \"!git daemon --verbose --reuseaddr --export-all --enable=receive-pack --base-path=\\\"$1\\\" #\"\n\n  remote-origin-https-to-ssh = \"!git remote set-url origin $(git remote get-url origin | sed 's|.*://|git@|; s|/|:|')\"\n\n  assume-unchanged = update-index --assume-unchanged\n  assume-changed = update-index --no-assume-unchanged\n\n[url \"git@github.com:\"]\n  #insteadOf = \"https://github.com/\" # force SSH instead of HTTP\n  insteadOf = \"github:\" # shortcut\n  pushInsteadOf = \"git://github.com/\"\n  pushInsteadOf = \"https://github.com/\"\n\n[url \"git@gitlab.com:\"]\n  #insteadOf = \"https://gitlab.com/\" # force SSH instead of HTTP\n  insteadOf = \"gitlab:\" # shortcut\n  pushInsteadOf = \"git://gitlab.com/\"\n  pushInsteadOf = \"https://gitlab.com/\"\n\n[url \"git@bitbucket.org:\"]\n  #insteadOf = \"https://bitbucket.org/\" # force SSH instead of HTTP\n  insteadOf = \"bitbucket:\" # shortcut\n  pushInsteadOf = \"git://bitbucket.org/\"\n  pushInsteadOf = \"https://bitbucket.org/\"\n\n[url \"git@heroku.com:\"]\n  insteadOf = \"heroku:\" # shortcut\n\n# Prettier inline JSON diff\n[diff \"json\"]\n  textconv = \"perl -MJSON::PP -e '$j = JSON::PP->new->pretty->canonical; print $j->encode($j->decode(do {$/ = undef; <>}))'\"\n  cachetextconv = true\n\n[filter \"transmission-conf\"]\n  clean = \"grep -Ev '\\\"(alt-speed-enabled|blocklist-date|main-window-[-a-z]+|open-dialog-dir|rpc-password)\\\":'\"\n  smudge = cat\n\n#[diff \"bin\"]\n#  textconv = hexdump -v -C\n\n# Merge drivers\n# .gitattributes example: file merge=ours\n[merge \"theirs\"]\n  driver = cp -f %B %A\n\n[merge \"ours\"]\n  driver = true\n"},{"id":"365107","messageId":"CACsJy8AjWXBycFEY-hmPB270BzcydxG6xQ6ox96VbK3K-sUnZw@mail.gmail.com","threadId":"50009","inReplyTo":"CAKc7PVAzSOknfmy7p09zF4LOi4t66CBmd27ZuQ39_wKYWSiiUA@mail.gmail.com","subject":"Re: [BUG] Git 2.20: `git help -a' hangs if specific git alias occurs","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-12-11T17:46:19Z","receivedAt":"2018-12-11T17:46:48Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, Dec 11, 2018 at 6:42 PM Sebastian Gniazdowski\n<sgniazdowski@gmail.com> wrote:\n>\n> Hello,\n> I've attached a screenshot for running `git help -a' that ends in a\n> hang and ~100% cpu usage, for the following ~/.gitconfig (it's also\n> attached):\n>\n> https://raw.githubusercontent.com/agostonbarna/dotfiles-base/master/.gitconfig\n>\n> So it's hangs on the alias `remote-origin-https-to-ssh'. One user in\n> following thread discovered, that it's about lenght of the alias:\n> \"abcdefghijklmnopqr = ... is ok, but with abcdefghijklmnopqrs = ...\"\n> it will crash, \"the problem occurs if the name of a git alias consists\n> of more than 18 characters\" (see the thread:\n> https://github.com/zdharma/fast-syntax-highlighting/issues/95).\n>\n> Is there a workaround? Of course a fix is needed, but I'm interested\n> specifically in a workaround so my Zsh plugin\n> `fast-syntax-highlighting' can work without hang also with Git 2.20,\n> without exceptions in code.\n\nI don't think there's a workaround (except shortening the aliases).\nThe fix for this was sent out just a couple hours ago, maybe it'll hit\n2.20.1\n\nhttps://public-inbox.org/git/pull.97.git.gitgitgadget@gmail.com/T/#t\n\n\n> --\n> Sebastian Gniazdowski\n> News: https://twitter.com/ZdharmaI\n> IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin\n> Blog: http://zdharma.org\n\n\n\n-- \nDuy\n"},{"id":"365108","messageId":"20181211174659.GU30222@szeder.dev","threadId":"50009","inReplyTo":"CAKc7PVAzSOknfmy7p09zF4LOi4t66CBmd27ZuQ39_wKYWSiiUA@mail.gmail.com","subject":"Re: [BUG] Git 2.20: `git help -a' hangs if specific git alias occurs","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-12-11T17:46:59Z","receivedAt":"2018-12-11T17:47:08Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Tue, Dec 11, 2018 at 06:30:26PM +0100, Sebastian Gniazdowski wrote:\n> Hello,\n> I've attached a screenshot for running `git help -a' that ends in a\n> hang and ~100% cpu usage, for the following ~/.gitconfig (it's also\n> attached):\n> \n> https://raw.githubusercontent.com/agostonbarna/dotfiles-base/master/.gitconfig\n> \n> So it's hangs on the alias `remote-origin-https-to-ssh'. One user in\n> following thread discovered, that it's about lenght of the alias:\n> \"abcdefghijklmnopqr = ... is ok, but with abcdefghijklmnopqrs = ...\"\n> it will crash, \"the problem occurs if the name of a git alias consists\n> of more than 18 characters\" (see the thread:\n> https://github.com/zdharma/fast-syntax-highlighting/issues/95).\n> \n> Is there a workaround? Of course a fix is needed, but I'm interested\n> specifically in a workaround so my Zsh plugin\n> `fast-syntax-highlighting' can work without hang also with Git 2.20,\n> without exceptions in code.\n\nHave a look at these patches:\n\n  https://public-inbox.org/git/pull.97.git.gitgitgadget@gmail.com/T/\n\nIt sounds like you hit the same issue.\n\n"}]}