Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH 3/4] _git: log: ignore numeric options




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.



Messages sorted by: Reverse Date, Date, Thread, Author