From: Sven Verdoolaege <skimo@kotnet.org>
This command dumps the config of a repository and will be used
to read config options from a remote site.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
.gitignore | 1 +
Documentation/cmd-list.perl | 1 +
Documentation/git-dump-config.txt | 37 +++++++++++++++++++++++++++++++++++++
Makefile | 1 +
daemon.c | 7 +++++++
dump-config.c | 29 +++++++++++++++++++++++++++++
6 files changed, 76 insertions(+), 0 deletions(-)
create mode 100644 Documentation/git-dump-config.txt
create mode 100644 dump-config.c
diff --git a/.gitignore b/.gitignore
index 4dc0c39..d4e5492 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,7 @@ git-diff-files
git-diff-index
git-diff-tree
git-describe
+git-dump-config
git-fast-import
git-fetch
git-fetch--tool
diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl
index 443802a..fa04615 100755
--- a/Documentation/cmd-list.perl
+++ b/Documentation/cmd-list.perl
@@ -103,6 +103,7 @@ git-diff-files plumbinginterrogators
git-diff-index plumbinginterrogators
git-diff mainporcelain
git-diff-tree plumbinginterrogators
+git-dump-config synchelpers
git-fast-import ancillarymanipulators
git-fetch mainporcelain
git-fetch-pack synchingrepositories
diff --git a/Documentation/git-dump-config.txt b/Documentation/git-dump-config.txt
new file mode 100644
index 0000000..370781c
--- /dev/null
+++ b/Documentation/git-dump-config.txt
@@ -0,0 +1,37 @@
+git-dump-config(1)
+====================
+
+NAME
+----
+git-dump-config - Dump config options
+
+
+SYNOPSIS
+--------
+'git-dump-config' <directory>
+
+DESCRIPTION
+-----------
+Invoked by 'git-config --remote' and dumps the config file to the
+other end over the git protocol.
+
+This command is usually not invoked directly by the end user. The UI
+for the protocol is on the 'git-config' side, where it is used to get
+options from a remote repository.
+
+OPTIONS
+-------
+<directory>::
+ The repository to get the config options from.
+
+Author
+------
+Written by Sven Verdoolaege.
+
+Documentation
+--------------
+Documentation by Sven Verdoolaege.
+
+GIT
+---
+Part of the gitlink:git[7] suite
diff --git a/Makefile b/Makefile
index 29243c6..37eb861 100644
--- a/Makefile
+++ b/Makefile
@@ -240,6 +240,7 @@ PROGRAMS = \
git-fast-import$X \
git-merge-base$X \
git-daemon$X \
+ git-dump-config$X \
git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \
git-peek-remote$X git-receive-pack$X \
git-send-pack$X git-shell$X \
diff --git a/daemon.c b/daemon.c
index e74ecac..3e5ebf3 100644
--- a/daemon.c
+++ b/daemon.c
@@ -378,10 +378,17 @@ static int receive_pack(void)
return -1;
}
+static int dump_config(void)
+{
+ execl_git_cmd("dump-config", ".", NULL);
+ return -1;
+}
+
static struct daemon_service daemon_service[] = {
{ "upload-archive", "uploadarch", upload_archive, 0, 1 },
{ "upload-pack", "uploadpack", upload_pack, 1, 1 },
{ "receive-pack", "receivepack", receive_pack, 0, 1 },
+ { "dump-config", "dumpconfig", dump_config, 0, 1 },
};
static void enable_service(const char *name, int ena) {
diff --git a/dump-config.c b/dump-config.c
new file mode 100644
index 0000000..355920d
--- /dev/null
+++ b/dump-config.c
@@ -0,0 +1,29 @@
+#include "git-compat-util.h"
+#include "cache.h"
+#include "pkt-line.h"
+
+static const char dump_config_usage[] = "git-dump-config <dir>";
+
+static int dump_config(const char *var, const char *value)
+{
+ packet_write(1, "%s", var);
+ packet_write(1, "%s", value);
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ char *dir;
+
+ if (argc != 2)
+ usage(dump_config_usage);
+
+ dir = argv[1];
+ if (!enter_repo(dir, 0))
+ die("'%s': unable to chdir or not a git archive", dir);
+
+ git_config(dump_config);
+ packet_flush(1);
+
+ return 0;
+}
--
1.5.2.rc3.783.gc7476-dirty
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Andrew Morton | 2.6.22-rc6-mm1 |
| Avi Kivity | [PATCH 002/104] KVM: SMP: Add vcpu_id field in struct vcpu |
| Pavel Machek | Re: suspend2 merge (was Re: [Suspend2-devel] Re: CFS and suspend2: hang in atomic ... |
| Con Kolivas | Re: -mm merge plans for 2.6.23 |
git: | |
| Junio C Hamano | What's cooking in git.git (topics) |
| Pazu | qgit on Mac OS X |
| Junio C Hamano | Re: [PATCH] Deprecate git-lost-found |
| Steffen Prohaska | Re: CVS -> SVN -> Git |
| Richard Stallman | Real men don't attack straw men |
| Siju George | Dell Latitude D820 |
| Lars Noodén | Call for testing - uvideo(4) |
| peter | ntpd not synching |
| Stephen Pierce | SLS |
| Dave `geek' Gymer | WARNING (was Re: New afio release) |
| Theodore Ts'o | Re: Splitting comp.os.linux |
| Goetz Schuchart | Re: [?] df: cannot read table of mounted filesystems |
| magical mounts | 9 hours ago | Linux kernel |
| Problem in scim in Fedora 9 | 10 hours ago | Linux general |
| The new Western Digital power saving drives | 10 hours ago | Hardware |
| Battery Maximizer Software | 1 day ago | Linux kernel |
| windows folder creation surprise | 1 day ago | Windows |
| Firewall | 1 day ago | OpenBSD |
| IP layer send packet | 2 days ago | Linux kernel |
| dtrace for linux available | 2 days ago | Linux kernel |
| Unable to mount ramdisk image using UBoot while upgrading to 2.6.15 kernel for a MPC8540 based target | 3 days ago | Linux kernel |
| RealTek RTL8169 - can't connect | 3 days ago | NetBSD |
