From e8daf78a00fc618f4b8b5b6253580226560f7dec Mon Sep 17 00:00:00 2001 From: Franck Bui-Huu Date: Mon, 25 Sep 2006 12:31:52 +0200 Subject: [PATCH 1/3] git-archive: update documentation This patch documents zip backend options. It also adds git-archive command into the main git manual page. Signed-off-by: Franck Bui-Huu Signed-off-by: Junio C Hamano --- Documentation/git-archive.txt | 13 +++++++++++++ Documentation/git.txt | 3 +++ 2 files changed, 16 insertions(+) diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt index 913528d373..031fcd5190 100644 --- a/Documentation/git-archive.txt +++ b/Documentation/git-archive.txt @@ -40,6 +40,7 @@ OPTIONS :: This can be any options that the archiver backend understand. + See next section. --remote=:: Instead of making a tar archive from local repository, @@ -52,6 +53,18 @@ path:: If one or more paths are specified, include only these in the archive, otherwise include all files and subdirectories. +BACKEND EXTRA OPTIONS +--------------------- + +zip +~~~ +-0:: + Store the files instead of deflating them. +-9:: + Highest and slowest compression level. You can specify any + number from 1 to 9 to adjust compression speed and ratio. + + CONFIGURATION ------------- By default, file and directories modes are set to 0666 or 0777 in tar diff --git a/Documentation/git.txt b/Documentation/git.txt index 1bf5ef57e4..2135b65516 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -266,6 +266,9 @@ gitlink:git-am[1]:: gitlink:git-applymbox[1]:: Apply patches from a mailbox, original version by Linus. +gitlink:git-archive[1]:: + Creates an archive of files from a named tree. + gitlink:git-bisect[1]:: Find the change that introduced a bug by binary search. From 4dafd7d2444051fe0e1eb17e9ded503ad7d9dd25 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Mon, 25 Sep 2006 23:19:00 +0200 Subject: [PATCH 2/3] Use const for interpolate arguments Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- interpolate.c | 6 +++--- interpolate.h | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/interpolate.c b/interpolate.c index d82f1b51bb..4570c123dc 100644 --- a/interpolate.c +++ b/interpolate.c @@ -25,10 +25,10 @@ */ int interpolate(char *result, int reslen, - char *orig, - struct interp *interps, int ninterps) + const char *orig, + const struct interp *interps, int ninterps) { - char *src = orig; + const char *src = orig; char *dest = result; int newlen = 0; char *name, *value; diff --git a/interpolate.h b/interpolate.h index 00c63a5622..d16f9244f3 100644 --- a/interpolate.h +++ b/interpolate.h @@ -5,6 +5,11 @@ #ifndef INTERPOLATE_H #define INTERPOLATE_H +/* + * Convert a NUL-terminated string in buffer orig, + * performing substitutions on %-named sub-strings from + * the interpretation table. + */ struct interp { char *name; @@ -12,7 +17,7 @@ struct interp { }; extern int interpolate(char *result, int reslen, - char *orig, - struct interp *interps, int ninterps); + const char *orig, + const struct interp *interps, int ninterps); #endif /* INTERPOLATE_H */ From 9c7b0b3fc46e552bde1a65cd1950c3634854332b Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Tue, 26 Sep 2006 07:23:37 +0200 Subject: [PATCH 3/3] Remove empty ref directories that prevent creating a ref. This patch also adds test cases from Linus and Junio. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- git-branch.sh | 10 ++++++++++ t/t3200-branch.sh | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/git-branch.sh b/git-branch.sh index e0501ec23f..4f31903d63 100755 --- a/git-branch.sh +++ b/git-branch.sh @@ -112,6 +112,16 @@ rev=$(git-rev-parse --verify "$head") || exit git-check-ref-format "heads/$branchname" || die "we do not like '$branchname' as a branch name." +if [ -d "$GIT_DIR/refs/heads/$branchname" ] +then + for refdir in `cd "$GIT_DIR" && \ + find "refs/heads/$branchname" -type d | sort -r` + do + rmdir "$GIT_DIR/$refdir" || \ + die "Could not delete '$refdir', there may still be a ref there." + done +fi + if [ -e "$GIT_DIR/refs/heads/$branchname" ] then if test '' = "$force" diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index 5b04efc89d..6907cbcd29 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -61,4 +61,16 @@ test_expect_success \ test -f .git/logs/refs/heads/g/h/i && diff expect .git/logs/refs/heads/g/h/i' +test_expect_success \ + 'git branch j/k should work after branch j has been deleted' \ + 'git-branch j && + git-branch -d j && + git-branch j/k' + +test_expect_success \ + 'git branch l should work after branch l/m has been deleted' \ + 'git-branch l/m && + git-branch -d l/m && + git-branch l' + test_done