git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [BUG] Git 2.20: `git help -a' hangs if specific git alias occurs
@ 2018-12-11 17:30 Sebastian Gniazdowski
  2018-12-11 17:46 ` Duy Nguyen
  2018-12-11 17:46 ` SZEDER Gábor
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Gniazdowski @ 2018-12-11 17:30 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]

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

[-- Attachment #2: gitconfig-crash-95.txt --]
[-- Type: text/plain, Size: 6869 bytes --]

[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

[-- Attachment #3: git-help--a-crash-95.png --]
[-- Type: image/png, Size: 20853 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] Git 2.20: `git help -a' hangs if specific git alias occurs
  2018-12-11 17:30 [BUG] Git 2.20: `git help -a' hangs if specific git alias occurs Sebastian Gniazdowski
@ 2018-12-11 17:46 ` Duy Nguyen
  2018-12-11 17:46 ` SZEDER Gábor
  1 sibling, 0 replies; 3+ messages in thread
From: Duy Nguyen @ 2018-12-11 17:46 UTC (permalink / raw)
  To: sgniazdowski; +Cc: Git Mailing List

On Tue, Dec 11, 2018 at 6:42 PM Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
>
> 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.

I don't think there's a workaround (except shortening the aliases).
The fix for this was sent out just a couple hours ago, maybe it'll hit
2.20.1

https://public-inbox.org/git/pull.97.git.gitgitgadget@gmail.com/T/#t


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



-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] Git 2.20: `git help -a' hangs if specific git alias occurs
  2018-12-11 17:30 [BUG] Git 2.20: `git help -a' hangs if specific git alias occurs Sebastian Gniazdowski
  2018-12-11 17:46 ` Duy Nguyen
@ 2018-12-11 17:46 ` SZEDER Gábor
  1 sibling, 0 replies; 3+ messages in thread
From: SZEDER Gábor @ 2018-12-11 17:46 UTC (permalink / raw)
  To: Sebastian Gniazdowski; +Cc: git

On Tue, Dec 11, 2018 at 06:30:26PM +0100, Sebastian Gniazdowski wrote:
> 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.

Have a look at these patches:

  https://public-inbox.org/git/pull.97.git.gitgitgadget@gmail.com/T/

It sounds like you hit the same issue.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-11 17:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 17:30 [BUG] Git 2.20: `git help -a' hangs if specific git alias occurs Sebastian Gniazdowski
2018-12-11 17:46 ` Duy Nguyen
2018-12-11 17:46 ` SZEDER Gábor

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git