Skip to content

Commit

Permalink
dag: pass unknown arguments along to git-log
Browse files Browse the repository at this point in the history
Use parse_known_args() and arrange for all unknown arguments to be
passed along to git-log via the dag query.  This allows any git-log
specific option to be passed to git-dag without its command-line parser
getting in the way.

Closes #389

Signed-off-by: David Aguilar <davvid@gmail.com>
  • Loading branch information
davvid committed Dec 29, 2014
1 parent 5f428c0 commit e9851da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/git-dag
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ def parse_args():
help='number of commits to display')
parser.add_argument('args', nargs='*', metavar='<args>',
help='git log arguments')
return parser.parse_args()
args, rest = parser.parse_known_args()
if rest:
# splice unknown arguments to the beginning ~
# these are forwarded to git-log(1).
args.args[:0] = rest
return args


def cmd_dag(args):
Expand Down
4 changes: 4 additions & 0 deletions share/doc/git-cola/relnotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ git-cola v2.1.0
===============
Usability, bells and whistles
-----------------------------
* `git dag` now forwards all unknown arguments along to `git log`.

https://github.com/git-cola/git-cola/issues/389

* Line-by-line interactive staging was made more precise.

git-cola v2.0.8
Expand Down

0 comments on commit e9851da

Please sign in to comment.