summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-06-19 19:31:39 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-06-20 09:54:45 +0200
commita5133fd2f7a489dac707a07263e43a404e55c97b (patch)
tree41d9370649ce9f075b81efc69036fcc1ffca8221
parente14ffd11db6546db00594d33e251e6cde5835e25 (diff)
support multiple names for aliases in .git-gpush-aliases
aka, aliases for aliases Change-Id: I587283e785fe1d77153f19f752175e7cc432efd9 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
-rw-r--r--bin/.git-gpush-aliases9
-rwxr-xr-xbin/git-gpush7
2 files changed, 9 insertions, 7 deletions
diff --git a/bin/.git-gpush-aliases b/bin/.git-gpush-aliases
index 771bb41..81eda65 100644
--- a/bin/.git-gpush-aliases
+++ b/bin/.git-gpush-aliases
@@ -7,8 +7,7 @@ bnilsen=bjnilsen
bogdan=taipan
danimo=dmolkent
ddenis=dzyubenk
-dt|home=dt
-dt|tt=dt
+dt|tt,dt|home=dt
fkleint=kleint
fregl=frederik
harryf=fernenge
@@ -17,11 +16,9 @@ jlind=jolind
jobor=jbornema
khansen=kenthans
lars=laknoll
-mariusso=stormols
-mstormo=stormols
+mariusso,mstormo=stormols
msorvig=sorvig
-ossi=buddenha
-ossi|tt=buddenha
+ossi,ossi|tt=buddenha
paulot=tvete
roberto__=raggi
sahumada=seahumad
diff --git a/bin/git-gpush b/bin/git-gpush
index 24c5ba3..bb3b1b0 100755
--- a/bin/git-gpush
+++ b/bin/git-gpush
@@ -43,6 +43,9 @@ Description:
An alias may contain multiple comma-separated email addresses;
for example, to set a single alias for an entire team.
+ Inside .git-gpush-aliases, each alias may also be a comma-separated
+ list, in case a user uses multiple handles.
+
If no sha1 or ref-from is specified or configured, 'HEAD' is used.
You may configure a ref-from like this
git config gpush.ref-from <ref-from value>
@@ -146,7 +149,9 @@ sub load_aliases
chomp $line;
$line =~ s,(#|//).*$,,; # Remove any comments
if ($line =~ /([^ ]+)\s*=\s*(\S+)/) { # Capture the alias
- $self->{'aliases'}->{$1} = $2;
+ for my $alias (split(/,/, $1)) {
+ $self->{'aliases'}->{$alias} = $2;
+ }
}
}