forked from hoelzro/useful-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-outgoing
More file actions
executable file
·27 lines (20 loc) · 778 Bytes
/
git-outgoing
File metadata and controls
executable file
·27 lines (20 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl
use strict;
use warnings;
my ($current_branch) = grep { /^\*/ } qx(git branch --no-color);
$current_branch =~ s/^\*\s*//;
chomp $current_branch;
my ( $remote ) = @ARGV;
unless(defined $remote) {
$remote = qx(git config branch.$current_branch.remote);
chomp $remote;
die "$current_branch does not seem to be a tracking branch (branch.$current_branch.remote not found)\n" unless $remote;
my $merge = qx(git config branch.$current_branch.merge);
$merge =~ s/.*\///;
chomp $merge;
die "$current_branch does not seem to be a tracking branch (branch.$current_branch.merge not found)\n" unless $merge;
system "git fetch $remote >/dev/null";
exit($? >> 8) if $@;
$remote .= "/$merge";
}
exec 'git', 'log', "$remote..HEAD";