zsh-workers
 help / color / mirror / code / Atom feed
From: m0viefreak <m0viefreak.cm@googlemail.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH 3/4] _git: log: ignore numeric options
Date: Wed, 16 Mar 2016 21:43:37 +0100	[thread overview]
Message-ID: <56E9C579.70608@googlemail.com> (raw)
In-Reply-To: <20160315000837.GA29956@tarsus.local2>



On 15.03.2016 01:08, Daniel Shahaf wrote:
> I couldn't reproduce that: with current master, none of «git log
> -<TAB>», «git log -9<TAB>», or «git log -9 -<TAB>» go through the
> 'first-commit-ranges-or-files' code branch.
> 
> m0viefreak, if there is still a (possibly latent) bug in current master,
> could you please explain/show it?

git log -9 <TAB>

should go through the 'first-commit-ranges-or-files' branch because at
that position the first argument is expected.

Without this patch it goes through the 'commit-ranges-or-files' branch,
because '-9' is wrongly treated as the first non-option argument:


functions -T _git-log; git log -9 <TAB>

without this patch:
+_git-log:16> case commit-ranges-or-files (first-commit-ranges-or-files)
+_git-log:16> case commit-ranges-or-files (commit-ranges-or-files)
+_git-log:28> [[ -z '' ]]
+_git-log:29> __git_commit_ranges
+_git-log:29> ret=0
+_git-log:35> __git_is_committish_range -9
+_git-log:37> __git_is_committish -9
+_git-log:40> __git_tree_files . HEAD
+_git-log:40> ret=0
+_git-log:45> return ret

with this patch:
+_git-log:16> case first-commit-ranges-or-files (first-commit-ranges-or-files)
+_git-log:18> [[ -n '' ]]
+_git-log:21> _alternative commit-ranges::__git_commit_ranges 'cached-files::__git_tree_files ${PREFIX:-.} HEAD'
+_git-log:23> ret=0
+_git-log:45> return ret


This patch makes _arguments ignore any words of the form '-[0-9]#' to
work around that.


  reply	other threads:[~2016-03-16 20:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-13 22:01 [PATCH 0/4] A few patches to _git m0viefreak
2016-03-13 22:01 ` [PATCH 1/4] _git: reflog: complete references next to commands m0viefreak
2016-03-15  0:08   ` Daniel Shahaf
2016-03-13 22:01 ` [PATCH 2/4] _git: fix tag name of remote branches m0viefreak
2016-03-15  0:08   ` Daniel Shahaf
2016-03-13 22:01 ` [PATCH 3/4] _git: log: ignore numeric options m0viefreak
2016-03-15  0:08   ` Daniel Shahaf
2016-03-16 20:43     ` m0viefreak [this message]
2016-03-16 22:39       ` Daniel Shahaf
2016-03-16 23:00         ` m0viefreak
2016-03-13 22:02 ` [PATCH 4/4] completion: _git: diff: add --no-index m0viefreak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E9C579.70608@googlemail.com \
    --to=m0viefreak.cm@googlemail.com \
    --cc=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).