summaryrefslogtreecommitdiff
path: root/git-debrebase
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-25 21:25:11 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-06-16 12:25:49 +0100
commitd26b06ee24c7993251a00b6ab01121245d74b152 (patch)
tree915c0698fd6b6903278a553811d5dd3b205ebe72 /git-debrebase
parent63474879c4c22b2399fe5c6186171fe749603541 (diff)
git-debrebase: Stub script to prove config handling works
Tested with PATH=$PWD:$PATH git -c wombat.foo.bar=23 -c wombat.foo.bar=37 debrebase Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'git-debrebase')
-rwxr-xr-xgit-debrebase39
1 files changed, 39 insertions, 0 deletions
diff --git a/git-debrebase b/git-debrebase
new file mode 100755
index 0000000..0d9e936
--- /dev/null
+++ b/git-debrebase
@@ -0,0 +1,39 @@
+#!/usr/bin/perl -w
+# git-debrebase
+# Script helping make fast-forwarding histories while still rebasing
+# upstream deltas when working on Debian packaging
+#
+# Copyright (C)2017 Ian Jackson
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+use strict;
+use Memoize;
+
+use Debian::Dgit;
+
+sub cfg ($) {
+ my ($k) = @_;
+ $/ = "\0";
+ my @cmd = qw(git config -z);
+ push @cmd, qw(--get-all) if wantarray;
+ push @cmd, $k;
+ my $out = cmdoutput @cmd;
+ return split /\0/, $out;
+}
+
+memoize('cfg');
+
+use Data::Dumper;
+print Dumper(cfg('wombat.foo.bar'));