chiark / gitweb /
0d9e936d978c38934be3476a3fd81ec90c5bf7d0
[dgit.git] / git-debrebase
1 #!/usr/bin/perl -w
2 # git-debrebase
3 # Script helping make fast-forwarding histories while still rebasing
4 # upstream deltas when working on Debian packaging
5 #
6 # Copyright (C)2017 Ian Jackson
7 #
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21 use strict;
22 use Memoize;
23
24 use Debian::Dgit;
25
26 sub cfg ($) {
27     my ($k) = @_;
28     $/ = "\0";
29     my @cmd = qw(git config -z);
30     push @cmd, qw(--get-all) if wantarray;
31     push @cmd, $k;
32     my $out = cmdoutput @cmd;
33     return split /\0/, $out;
34 }
35
36 memoize('cfg');
37
38 use Data::Dumper;
39 print Dumper(cfg('wombat.foo.bar'));