From d50a4bc4e91f03cecc337e5e95dc4c0e0a4054f0 Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Tue, 6 Nov 2007 08:54:18 +0000 Subject: git-mailsplit: with maildirs not only process cur/, but also new/ When saving patches to a maildir with e.g. mutt, the files are put into the new/ subdirectory of the maildir, not cur/. This makes git-am state "Nothing to do.". This patch lets git-mailsplit additional check new/ after reading cur/. This was reported by Joey Hess through http://bugs.debian.org/447396 Signed-off-by: Gerrit Pape Acked-by: Jeff King Acked-by: Alex Riesen Acked-by: Fernando J. Pereda Signed-off-by: Junio C Hamano --- builtin-mailsplit.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c index 43fc373a1..10fa17734 100644 --- a/builtin-mailsplit.c +++ b/builtin-mailsplit.c @@ -101,20 +101,29 @@ static int populate_maildir_list(struct path_list *list, const char *path) { DIR *dir; struct dirent *dent; + char name[PATH_MAX]; + char *subs[] = { "cur", "new", NULL }; + char **sub; + + for (sub = subs; *sub; ++sub) { + snprintf(name, sizeof(name), "%s/%s", path, *sub); + if ((dir = opendir(name)) == NULL) { + if (errno == ENOENT) + continue; + error("cannot opendir %s (%s)", name, strerror(errno)); + return -1; + } - if ((dir = opendir(path)) == NULL) { - error("cannot opendir %s (%s)", path, strerror(errno)); - return -1; - } + while ((dent = readdir(dir)) != NULL) { + if (dent->d_name[0] == '.') + continue; + snprintf(name, sizeof(name), "%s/%s", *sub, dent->d_name); + path_list_insert(name, list); + } - while ((dent = readdir(dir)) != NULL) { - if (dent->d_name[0] == '.') - continue; - path_list_insert(dent->d_name, list); + closedir(dir); } - closedir(dir); - return 0; } @@ -122,19 +131,17 @@ static int split_maildir(const char *maildir, const char *dir, int nr_prec, int skip) { char file[PATH_MAX]; - char curdir[PATH_MAX]; char name[PATH_MAX]; int ret = -1; int i; struct path_list list = {NULL, 0, 0, 1}; - snprintf(curdir, sizeof(curdir), "%s/cur", maildir); - if (populate_maildir_list(&list, curdir) < 0) + if (populate_maildir_list(&list, maildir) < 0) goto out; for (i = 0; i < list.nr; i++) { FILE *f; - snprintf(file, sizeof(file), "%s/%s", curdir, list.items[i].path); + snprintf(file, sizeof(file), "%s/%s", maildir, list.items[i].path); f = fopen(file, "r"); if (!f) { error("cannot open mail %s (%s)", file, strerror(errno)); @@ -152,10 +159,9 @@ static int split_maildir(const char *maildir, const char *dir, fclose(f); } - path_list_clear(&list, 1); - ret = skip; out: + path_list_clear(&list, 1); return ret; } -- cgit v1.2.1 From b5e960b108b48b3ebd92a3c1b22b13a9edd127dc Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Thu, 8 Nov 2007 22:47:36 +0100 Subject: Avoid a few unportable, needlessly nested "...`...". Signed-off-by: Ralf Wildenhues Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 2 +- git-request-pull.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index f28c3df20..d65df2cb8 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -361,7 +361,7 @@ do -s|--strategy) case "$#,$1" in *,*=*) - STRATEGY="-s `expr "z$1" : 'z-[^=]*=\(.*\)'`" ;; + STRATEGY="-s "$(expr "z$1" : 'z-[^=]*=\(.*\)') ;; 1,*) usage ;; *) diff --git a/git-request-pull.sh b/git-request-pull.sh index a99243067..95ad66630 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -24,13 +24,13 @@ headrev=`git rev-parse --verify "$head"^0` || exit merge_base=`git merge-base $baserev $headrev` || die "fatal: No commits in common between $base and $head" -url="`get_remote_url "$url"`" -branch=`git peek-remote "$url" \ +url=$(get_remote_url "$url") +branch=$(git peek-remote "$url" \ | sed -n -e "/^$headrev refs.heads./{ s/^.* refs.heads.// p q - }"` + }") if [ -z "$branch" ]; then echo "warn: No branch of $url is at:" >&2 git log --max-count=1 --pretty='format:warn: %h: %s' $headrev >&2 -- cgit v1.2.1 From 4f2e94c0f7685f9c58e67b0651147684efb0f57e Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Thu, 8 Nov 2007 22:48:49 +0100 Subject: Fix sed string regex escaping in module_name. When escaping a string to be used as a sed regex, it is important to only escape active characters. Escaping other characters is undefined according to POSIX, and in practice leads to issues with extensions such as GNU sed's \+. Signed-off-by: Ralf Wildenhues Signed-off-by: Junio C Hamano --- git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index 673aa27a4..b91d62632 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -47,7 +47,7 @@ get_repo_base() { module_name() { # Do we have "submodule..path = $1" defined in .gitmodules file? - re=$(printf '%s' "$1" | sed -e 's/\([^a-zA-Z0-9_]\)/\\\1/g') + re=$(printf '%s' "$1" | sed -e 's/[].[^$\\*]/\\&/g') name=$( GIT_CONFIG=.gitmodules \ git config --get-regexp '^submodule\..*\.path$' | sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' ) -- cgit v1.2.1 From fbbdbfc3ccff209136c9f94fed8321e5d3d0ca85 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 8 Nov 2007 16:24:00 -0800 Subject: refresh_index_quietly(): express "optional" nature of index writing better The point of the part of the code this patch touches is that if we modified the active_cache, we try to write it out and make it the index file for later users to use by calling "commit_locked_index", but we do not really care about the failure from this sequence because it is done purely as an optimization. The original code called three functions primarily for their side effects but as condition of an if statement, which is admittedly a bad style. Incidentally, it squelches an "empty if body" warning from gcc. Signed-off-by: Junio C Hamano --- builtin-diff.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/builtin-diff.c b/builtin-diff.c index f77352b40..f557d2192 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -200,15 +200,11 @@ static void refresh_index_quietly(void) discard_cache(); read_cache(); refresh_cache(REFRESH_QUIET|REFRESH_UNMERGED); - if (active_cache_changed) { - if (write_cache(fd, active_cache, active_nr) || - close(fd) || - commit_locked_index(lock_file)) - ; /* - * silently ignore it -- we haven't mucked - * with the real index. - */ - } + + if (active_cache_changed && + !write_cache(fd, active_cache, active_nr) && !close(fd)) + commit_locked_index(lock_file); + rollback_lock_file(lock_file); } -- cgit v1.2.1 From d349a03e7401625a9bb92f403f36923472e498c6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 8 Nov 2007 16:41:56 -0800 Subject: Makefile: add missing dependency on wt-status.h Signed-off-by: Junio C Hamano --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index e70e3209d..2331e45ad 100644 --- a/Makefile +++ b/Makefile @@ -894,6 +894,7 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS) $(LIB_OBJS) $(BUILTIN_OBJS) fetch.o: $(LIB_H) $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) $(DIFF_OBJS): diffcore.h +builtin-revert.o builtin-runstatus.o wt-status.o: wt-status.h $(LIB_FILE): $(LIB_OBJS) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS) -- cgit v1.2.1 From d9c8344b467bb97b8dca8d811c99d4735eca88f2 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Fri, 9 Nov 2007 00:41:39 +0100 Subject: stop t1400 hiding errors in tests The last rm in the test was lacking an "&&" before it, which caused the errors in the commands be silently hidden. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- t/t1400-update-ref.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index ce045b2a5..a90824ba8 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -205,7 +205,7 @@ test_expect_success \ echo $h_TEST >.git/MERGE_HEAD && GIT_AUTHOR_DATE="2005-05-26 23:45" \ GIT_COMMITTER_DATE="2005-05-26 23:45" git-commit -F M && - h_MERGED=$(git rev-parse --verify HEAD) + h_MERGED=$(git rev-parse --verify HEAD) && rm -f M' cat >expect < Date: Fri, 9 Nov 2007 00:21:42 +0100 Subject: instaweb: Minor cleanups and fixes for potential problems Fix path quoting and test of empty values that some shells do not like. Remove duplicate check and setting of $browser. Signed-off-by: Jonas Fonseca Signed-off-by: Junio C Hamano --- git-instaweb.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/git-instaweb.sh b/git-instaweb.sh index 41ff08f8e..2ca487d7d 100755 --- a/git-instaweb.sh +++ b/git-instaweb.sh @@ -15,7 +15,7 @@ browser="`git config --get instaweb.browser`" port=`git config --get instaweb.port` module_path="`git config --get instaweb.modulepath`" -conf=$GIT_DIR/gitweb/httpd.conf +conf="$GIT_DIR/gitweb/httpd.conf" # Defaults: @@ -32,7 +32,7 @@ start_httpd () { httpd_only="`echo $httpd | cut -f1 -d' '`" if case "$httpd_only" in /*) : ;; *) which $httpd_only >/dev/null;; esac then - $httpd $fqgitdir/gitweb/httpd.conf + $httpd "$fqgitdir/gitweb/httpd.conf" else # many httpds are installed in /usr/sbin or /usr/local/sbin # these days and those are not in most users $PATHs @@ -146,14 +146,14 @@ server.pid-file = "$fqgitdir/pid" cgi.assign = ( ".cgi" => "" ) mimetype.assign = ( ".css" => "text/css" ) EOF - test "$local" = true && echo 'server.bind = "127.0.0.1"' >> "$conf" + test x"$local" = xtrue && echo 'server.bind = "127.0.0.1"' >> "$conf" } apache2_conf () { test -z "$module_path" && module_path=/usr/lib/apache2/modules mkdir -p "$GIT_DIR/gitweb/logs" bind= - test "$local" = true && bind='127.0.0.1:' + test x"$local" = xtrue && bind='127.0.0.1:' echo 'text/css css' > $fqgitdir/mime.types cat > "$conf" < Date: Thu, 8 Nov 2007 19:40:25 +0300 Subject: SubmittingPatches: improve the 'Patch:' section of the checklist There were 2 items "send patch to..." but having different set of addresses to send patch to. Merge them together and move the resulting item to the end of checklist. Signed-off-by: Sergei Organov Signed-off-by: Junio C Hamano --- Documentation/SubmittingPatches | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index 61635bf04..83bf54c7a 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches @@ -20,9 +20,6 @@ Checklist (and a short version for the impatient): Patch: - use "git format-patch -M" to create the patch - - send your patch to . If you use - git-send-email(1), please test it first by sending - email to yourself. - do not PGP sign your patch - do not attach your patch, but read in the mail body, unless you cannot teach your mailer to @@ -31,13 +28,15 @@ Checklist (and a short version for the impatient): corrupt whitespaces. - provide additional information (which is unsuitable for the commit message) between the "---" and the diffstat - - send the patch to the list (git@vger.kernel.org) and the - maintainer (gitster@pobox.com). - if you change, add, or remove a command line option or make some other user interface change, the associated documentation should be updated as well. - if your name is not writable in ASCII, make sure that you send off a message in the correct encoding. + - send the patch to the list (git@vger.kernel.org) and the + maintainer (gitster@pobox.com). If you use + git-send-email(1), please test it first by sending + email to yourself. Long version: -- cgit v1.2.1 From cb6c162fba3fe3e1333b48c6062c18108c41fb82 Mon Sep 17 00:00:00 2001 From: Benoit Sigoure Date: Thu, 8 Nov 2007 19:56:28 +0100 Subject: git-send-email: Change the prompt for the subject of the initial message. I never understood what this prompt was asking for until I read the actual source code. I think this wording is much more understandable. Signed-off-by: Benoit Sigoure Signed-off-by: Junio C Hamano --- git-send-email.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-send-email.perl b/git-send-email.perl index 9547cc37a..8760cf88a 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -303,7 +303,7 @@ sub expand_aliases { if (!defined $initial_subject && $compose) { do { - $_ = $term->readline("What subject should the emails start with? ", + $_ = $term->readline("What subject should the initial email start with? ", $initial_subject); } while (!defined $_); $initial_subject = $_; -- cgit v1.2.1 From b9217c09386e5313ac6a54cc91cf03149514154b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 9 Nov 2007 00:17:26 -0800 Subject: Start preparing for 1.5.3.6 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.5.3.6.txt | 21 +++++++++++++++++++++ RelNotes | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 Documentation/RelNotes-1.5.3.6.txt diff --git a/Documentation/RelNotes-1.5.3.6.txt b/Documentation/RelNotes-1.5.3.6.txt new file mode 100644 index 000000000..06e44f773 --- /dev/null +++ b/Documentation/RelNotes-1.5.3.6.txt @@ -0,0 +1,21 @@ +GIT v1.5.3.6 Release Notes +========================== + +Fixes since v1.5.3.5 +-------------------- + + * git-cvsexportcommit handles root commits better; + + * git-svn dcommit used to clobber when sending a series of + patches; + + * git-grep sometimes refused to work when your index was + unmerged; + + * Quite a lot of documentation clarifications. + +-- +exec >/var/tmp/1 +O=v1.5.3.5-32-gcb6c162 +echo O=`git describe refs/heads/maint` +git shortlog --no-merges $O..refs/heads/maint diff --git a/RelNotes b/RelNotes index a1ee57eb5..07ff9722c 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes-1.5.3.5.txt \ No newline at end of file +Documentation/RelNotes-1.5.3.6.txt \ No newline at end of file -- cgit v1.2.1