Skip to content

Commit f79a45d

Browse files
authoredJul 11, 2016
Merge pull request #8 from mhagger/log-option
Add a `--log`/`-l` option
2 parents d0b454a + 9c54e27 commit f79a45d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed
 

‎README

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Options:
3535
characters (or more if needed to avoid ambiguity).
3636
See also whenmerged.abbrev below under CONFIGURATION.
3737
--no-abbrev Do not abbreviate commit SHA1s.
38+
-l, --log Show the log for the merge commit.
3839
-d, --diff Show the diff for the merge commit.
3940
-v, --visualize Visualize the merge commit using gitk.
4041

‎bin/git-when-merged

+10-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ Examples:
5050
git when-merged 0a1b -n releases # Use whenmerged.releases.pattern
5151
git when-merged 0a1b -s # Use whenmerged.default.pattern
5252
53-
git when-merged 0a1b -d feature-1 # Show diff for each merge commit
53+
git when-merged 0a1b -l feature-1 # Show log for the merge commit
54+
git when-merged 0a1b -d feature-1 # Show diff for the merge commit
5455
git when-merged 0a1b -v feature-1 # Display merge commit in gitk
5556
5657
Configuration:
@@ -353,6 +354,10 @@ def main(args):
353354
'--no-abbrev', dest='abbrev', action='store_const', const=None,
354355
help='Do not abbreviate commit SHA1s.',
355356
)
357+
parser.add_option(
358+
'--log', '-l', action='store_true', default=False,
359+
help='Show the log for the merge commit.',
360+
)
356361
parser.add_option(
357362
'--diff', '-d', action='store_true', default=False,
358363
help='Show the diff for the merge commit.',
@@ -420,8 +425,11 @@ def main(args):
420425
continue
421426

422427
if merge:
428+
if options.log:
429+
subprocess.check_call(['git', '--no-pager', 'log', '--no-walk', merge])
430+
423431
if options.diff:
424-
subprocess.check_call(['git', 'show', merge])
432+
subprocess.check_call(['git', '--no-pager', 'show', merge])
425433

426434
if options.visualize:
427435
subprocess.check_call(['gitk', '--all', '--select-commit=%s' % (merge,)])

0 commit comments

Comments
 (0)
Please sign in to comment.