Code

Merge branch 'jn/gitweb-unspecified-action' into maint-1.7.8
authorJunio C Hamano <gitster@pobox.com>
Tue, 20 Mar 2012 22:24:23 +0000 (15:24 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Mar 2012 22:24:23 +0000 (15:24 -0700)
* jn/gitweb-unspecified-action:
  gitweb: Fix actionless dispatch for non-existent objects

22 files changed:
Documentation/RelNotes/1.7.6.6.txt [new file with mode: 0644]
Documentation/RelNotes/1.7.7.6.txt [new file with mode: 0644]
Documentation/RelNotes/1.7.8.4.txt [new file with mode: 0644]
Documentation/RelNotes/1.7.8.5.txt [new file with mode: 0644]
Documentation/config.txt
Documentation/diff-options.txt
Documentation/git.txt
GIT-VERSION-GEN
Makefile
RelNotes
attr.c
builtin/pack-objects.c
diff-lib.c
git-am.sh
git-rebase--merge.sh
git-send-email.perl
grep.c
imap-send.c
t/t0003-attributes.sh
t/t2203-add-intent.sh
t/t4010-diff-pathspec.sh
t/t4150-am.sh

diff --git a/Documentation/RelNotes/1.7.6.6.txt b/Documentation/RelNotes/1.7.6.6.txt
new file mode 100644 (file)
index 0000000..5343e00
--- /dev/null
@@ -0,0 +1,16 @@
+Git v1.7.6.6 Release Notes
+==========================
+
+Fixes since v1.7.6.5
+--------------------
+
+ * The code to look up attributes for paths reused entries from a wrong
+   directory when two paths in question are in adjacent directories and
+   the name of the one directory is a prefix of the other.
+
+ * When producing a "thin pack" (primarily used in bundles and smart
+   HTTP transfers) out of a fully packed repository, we unnecessarily
+   avoided sending recent objects as a delta against objects we know
+   the other side has.
+
+Also contains minor fixes and documentation updates.
diff --git a/Documentation/RelNotes/1.7.7.6.txt b/Documentation/RelNotes/1.7.7.6.txt
new file mode 100644 (file)
index 0000000..8df606d
--- /dev/null
@@ -0,0 +1,20 @@
+Git v1.7.7.6 Release Notes
+==========================
+
+Fixes since v1.7.7.5
+--------------------
+
+ * The code to look up attributes for paths reused entries from a wrong
+   directory when two paths in question are in adjacent directories and
+   the name of the one directory is a prefix of the other.
+
+ * A wildcard that matches deeper hierarchy given to the "diff-index" command,
+   e.g. "git diff-index HEAD -- '*.txt'", incorrectly reported additions of
+   matching files even when there is no change.
+
+ * When producing a "thin pack" (primarily used in bundles and smart
+   HTTP transfers) out of a fully packed repository, we unnecessarily
+   avoided sending recent objects as a delta against objects we know
+   the other side has.
+
+Also contains minor fixes and documentation updates.
diff --git a/Documentation/RelNotes/1.7.8.4.txt b/Documentation/RelNotes/1.7.8.4.txt
new file mode 100644 (file)
index 0000000..9bebdbf
--- /dev/null
@@ -0,0 +1,23 @@
+Git v1.7.8.4 Release Notes
+==========================
+
+Fixes since v1.7.8.3
+--------------------
+
+ * The code to look up attributes for paths reused entries from a wrong
+   directory when two paths in question are in adjacent directories and
+   the name of the one directory is a prefix of the other.
+
+ * A wildcard that matches deeper hierarchy given to the "diff-index" command,
+   e.g. "git diff-index HEAD -- '*.txt'", incorrectly reported additions of
+   matching files even when there is no change.
+
+ * When producing a "thin pack" (primarily used in bundles and smart
+   HTTP transfers) out of a fully packed repository, we unnecessarily
+   avoided sending recent objects as a delta against objects we know
+   the other side has.
+
+ * "git send-email" did not properly treat sendemail.multiedit as a
+   boolean (e.g. setting it to "false" did not turn it off).
+
+Also contains minor fixes and documentation updates.
diff --git a/Documentation/RelNotes/1.7.8.5.txt b/Documentation/RelNotes/1.7.8.5.txt
new file mode 100644 (file)
index 0000000..011fd2a
--- /dev/null
@@ -0,0 +1,19 @@
+Git v1.7.8.5 Release Notes
+==========================
+
+Fixes since v1.7.8.4
+--------------------
+
+ * Dependency on our thread-utils.h header file was missing for
+   objects that depend on it in the Makefile.
+
+ * "git am" when fed an empty file did not correctly finish reading it
+   when it attempts to guess the input format.
+
+ * "git grep -P" (when PCRE is enabled in the build) did not match the
+   beginning and the end of the line correctly with ^ and $.
+
+ * "git rebase -m" tried to run "git notes copy" needlessly when
+   nothing was rewritten.
+
+Also contains minor fixes and documentation updates.
index 295939094f050c3b8ec1b95164bdd0b9b8c1dd95..9fba453f23754b3afc3268f9e6c1db90dca3e55e 100644 (file)
@@ -1740,7 +1740,8 @@ rerere.enabled::
        conflict hunks can be resolved automatically, should they be
        encountered again.  By default, linkgit:git-rerere[1] is
        enabled if there is an `rr-cache` directory under the
-       `$GIT_DIR`.
+       `$GIT_DIR`, e.g. if "rerere" was previously used in the
+       repository.
 
 sendemail.identity::
        A configuration identity. When given, causes values in the
index 9f7cba2be6a97cb85072d22b3317d37d1afe80bf..ba7cd13483194399762b0f48e218ddb4011dfcf1 100644 (file)
@@ -52,6 +52,9 @@ endif::git-format-patch[]
 --patience::
        Generate a diff using the "patience diff" algorithm.
 
+--histogram::
+       Generate a diff using the "histogram diff" algorithm.
+
 --stat[=<width>[,<name-width>[,<count>]]]::
        Generate a diffstat.  You can override the default
        output width for 80-column terminal by `--stat=<width>`.
index 8a77fa47adf1ddc96a942e190b1227b638017346..614693a83f951a35a8ead55dbd3f9f0a1256dbb7 100644 (file)
@@ -44,17 +44,19 @@ unreleased) version of git, that is available from 'master'
 branch of the `git.git` repository.
 Documentation for older releases are available here:
 
-* link:v1.7.8.3/git.html[documentation for release 1.7.8.3]
+* link:v1.7.8.4/git.html[documentation for release 1.7.8.4]
 
 * release notes for
+  link:RelNotes/1.7.8.4.txt[1.7.8.4],
   link:RelNotes/1.7.8.3.txt[1.7.8.3],
   link:RelNotes/1.7.8.2.txt[1.7.8.2],
   link:RelNotes/1.7.8.1.txt[1.7.8.1],
   link:RelNotes/1.7.8.txt[1.7.8].
 
-* link:v1.7.7.5/git.html[documentation for release 1.7.7.5]
+* link:v1.7.7.6/git.html[documentation for release 1.7.7.6]
 
 * release notes for
+  link:RelNotes/1.7.7.6.txt[1.7.7.6],
   link:RelNotes/1.7.7.5.txt[1.7.7.5],
   link:RelNotes/1.7.7.4.txt[1.7.7.4],
   link:RelNotes/1.7.7.3.txt[1.7.7.3],
@@ -62,9 +64,10 @@ Documentation for older releases are available here:
   link:RelNotes/1.7.7.1.txt[1.7.7.1],
   link:RelNotes/1.7.7.txt[1.7.7].
 
-* link:v1.7.6.5/git.html[documentation for release 1.7.6.5]
+* link:v1.7.6.6/git.html[documentation for release 1.7.6.6]
 
 * release notes for
+  link:RelNotes/1.7.6.6.txt[1.7.6.6],
   link:RelNotes/1.7.6.5.txt[1.7.6.5],
   link:RelNotes/1.7.6.4.txt[1.7.6.4],
   link:RelNotes/1.7.6.3.txt[1.7.6.3],
index 3d2a089add000a875fc8235e914b74c8ec2c1c91..c95c200eebfcfb1ff935045ee2fb850d317a03a7 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v1.7.8.3
+DEF_VER=v1.7.8.5
 
 LF='
 '
index b21d2f14176d08011cea79790eb2246d50787ec9..3031be5ee63facad10da45271ab04a4be4f3bb68 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -576,6 +576,7 @@ LIB_H += streaming.h
 LIB_H += string-list.h
 LIB_H += submodule.h
 LIB_H += tag.h
+LIB_H += thread-utils.h
 LIB_H += transport.h
 LIB_H += tree.h
 LIB_H += tree-walk.h
index 70bbc741e13ddf996f5a7a56f27e15deaed2c03d..dfc0e738d9198a8b9a85ed3c8b1f621f71b32f25 120000 (symlink)
--- a/RelNotes
+++ b/RelNotes
@@ -1 +1 @@
-Documentation/RelNotes/1.7.8.3.txt
\ No newline at end of file
+Documentation/RelNotes/1.7.8.5.txt
\ No newline at end of file
diff --git a/attr.c b/attr.c
index 76b079f0f530e1372b2866f40cce21ec5266394c..303751f6c2bd4d558cffbb928c636581efb2b310 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -301,6 +301,7 @@ static void free_attr_elem(struct attr_stack *e)
                }
                free(a);
        }
+       free(e->attrs);
        free(e);
 }
 
@@ -495,47 +496,48 @@ static int git_attr_system(void)
 
 static void bootstrap_attr_stack(void)
 {
-       if (!attr_stack) {
-               struct attr_stack *elem;
+       struct attr_stack *elem;
 
-               elem = read_attr_from_array(builtin_attr);
-               elem->origin = NULL;
-               elem->prev = attr_stack;
-               attr_stack = elem;
+       if (attr_stack)
+               return;
 
-               if (git_attr_system()) {
-                       elem = read_attr_from_file(git_etc_gitattributes(), 1);
-                       if (elem) {
-                               elem->origin = NULL;
-                               elem->prev = attr_stack;
-                               attr_stack = elem;
-                       }
-               }
+       elem = read_attr_from_array(builtin_attr);
+       elem->origin = NULL;
+       elem->prev = attr_stack;
+       attr_stack = elem;
 
-               if (git_attributes_file) {
-                       elem = read_attr_from_file(git_attributes_file, 1);
-                       if (elem) {
-                               elem->origin = NULL;
-                               elem->prev = attr_stack;
-                               attr_stack = elem;
-                       }
+       if (git_attr_system()) {
+               elem = read_attr_from_file(git_etc_gitattributes(), 1);
+               if (elem) {
+                       elem->origin = NULL;
+                       elem->prev = attr_stack;
+                       attr_stack = elem;
                }
+       }
 
-               if (!is_bare_repository() || direction == GIT_ATTR_INDEX) {
-                       elem = read_attr(GITATTRIBUTES_FILE, 1);
-                       elem->origin = xstrdup("");
+       if (git_attributes_file) {
+               elem = read_attr_from_file(git_attributes_file, 1);
+               if (elem) {
+                       elem->origin = NULL;
                        elem->prev = attr_stack;
                        attr_stack = elem;
-                       debug_push(elem);
                }
+       }
 
-               elem = read_attr_from_file(git_path(INFOATTRIBUTES_FILE), 1);
-               if (!elem)
-                       elem = xcalloc(1, sizeof(*elem));
-               elem->origin = NULL;
+       if (!is_bare_repository() || direction == GIT_ATTR_INDEX) {
+               elem = read_attr(GITATTRIBUTES_FILE, 1);
+               elem->origin = xstrdup("");
                elem->prev = attr_stack;
                attr_stack = elem;
+               debug_push(elem);
        }
+
+       elem = read_attr_from_file(git_path(INFOATTRIBUTES_FILE), 1);
+       if (!elem)
+               elem = xcalloc(1, sizeof(*elem));
+       elem->origin = NULL;
+       elem->prev = attr_stack;
+       attr_stack = elem;
 }
 
 static void prepare_attr_stack(const char *path)
@@ -575,14 +577,17 @@ static void prepare_attr_stack(const char *path)
 
        /*
         * Pop the ones from directories that are not the prefix of
-        * the path we are checking.
+        * the path we are checking. Break out of the loop when we see
+        * the root one (whose origin is an empty string "") or the builtin
+        * one (whose origin is NULL) without popping it.
         */
-       while (attr_stack && attr_stack->origin) {
+       while (attr_stack->origin) {
                int namelen = strlen(attr_stack->origin);
 
                elem = attr_stack;
                if (namelen <= dirlen &&
-                   !strncmp(elem->origin, path, namelen))
+                   !strncmp(elem->origin, path, namelen) &&
+                   (!namelen || path[namelen] == '/'))
                        break;
 
                debug_pop(elem);
@@ -594,8 +599,15 @@ static void prepare_attr_stack(const char *path)
         * Read from parent directories and push them down
         */
        if (!is_bare_repository() || direction == GIT_ATTR_INDEX) {
+               /*
+                * bootstrap_attr_stack() should have added, and the
+                * above loop should have stopped before popping, the
+                * root element whose attr_stack->origin is set to an
+                * empty string.
+                */
                struct strbuf pathbuf = STRBUF_INIT;
 
+               assert(attr_stack->origin);
                while (1) {
                        len = strlen(attr_stack->origin);
                        if (dirlen <= len)
index b1895aaaa1520ef910504c3beee685f95e72ec6b..ef703dfeb611c0820a68f4c7cebae154689fa5f5 100644 (file)
@@ -1456,11 +1456,16 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
                return -1;
 
        /*
-        * We do not bother to try a delta that we discarded
-        * on an earlier try, but only when reusing delta data.
+        * We do not bother to try a delta that we discarded on an
+        * earlier try, but only when reusing delta data.  Note that
+        * src_entry that is marked as the preferred_base should always
+        * be considered, as even if we produce a suboptimal delta against
+        * it, we will still save the transfer cost, as we already know
+        * the other side has it and we won't send src_entry at all.
         */
        if (reuse_delta && trg_entry->in_pack &&
            trg_entry->in_pack == src_entry->in_pack &&
+           !src_entry->preferred_base &&
            trg_entry->in_pack_type != OBJ_REF_DELTA &&
            trg_entry->in_pack_type != OBJ_OFS_DELTA)
                return 0;
index 62f4cd94cfbc4d3fe9e46c84f318af6624349a48..fc0dff31b58c8bd6668de5c6396a93b31cc5729d 100644 (file)
@@ -469,6 +469,8 @@ static int diff_cache(struct rev_info *revs,
        opts.src_index = &the_index;
        opts.dst_index = NULL;
        opts.pathspec = &revs->diffopt.pathspec;
+       opts.pathspec->recursive = 1;
+       opts.pathspec->max_depth = -1;
 
        init_tree_desc(&t, tree->buffer, tree->size);
        return unpack_trees(1, &t, &opts);
index 1c13b1399185506dd11750fe7e8c1b989a0f3d0c..f43a75b04bf692b9ff6acaae0f6bbe51369aa399 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -201,7 +201,7 @@ check_patch_format () {
                l1=
                while test -z "$l1"
                do
-                       read l1
+                       read l1 || break
                done
                read l2
                read l3
index 26afc75cc7d0fbf3de69325043130836c32454a0..dc599077f0e55472ae814ed4e15f5b3a1b729caf 100644 (file)
@@ -90,10 +90,13 @@ call_merge () {
 
 finish_rb_merge () {
        move_to_original_branch
-       git notes copy --for-rewrite=rebase < "$state_dir"/rewritten
-       if test -x "$GIT_DIR"/hooks/post-rewrite &&
-               test -s "$state_dir"/rewritten; then
-               "$GIT_DIR"/hooks/post-rewrite rebase < "$state_dir"/rewritten
+       if test -s "$state_dir"/rewritten
+       then
+               git notes copy --for-rewrite=rebase <"$state_dir"/rewritten
+               if test -x "$GIT_DIR"/hooks/post-rewrite
+               then
+                       "$GIT_DIR"/hooks/post-rewrite rebase <"$state_dir"/rewritten
+               fi
        fi
        rm -r "$state_dir"
        say All done.
index d491db92c9379cf0eea63182dd704feb6582b6e7..ef30c557c7dee549e891fe7605902ba58d0566a3 100755 (executable)
@@ -210,6 +210,7 @@ my %config_bool_settings = (
     "signedoffbycc" => [\$signed_off_by_cc, undef],
     "signedoffcc" => [\$signed_off_by_cc, undef],      # Deprecated
     "validate" => [\$validate, 1],
+    "multiedit" => [\$multiedit, undef]
 );
 
 my %config_settings = (
@@ -227,7 +228,6 @@ my %config_settings = (
     "bcc" => \@bcclist,
     "suppresscc" => \@suppress_cc,
     "envelopesender" => \$envelope_sender,
-    "multiedit" => \$multiedit,
     "confirm"   => \$confirm,
     "from" => \$sender,
     "assume8bitencoding" => \$auto_8bit_encoding,
diff --git a/grep.c b/grep.c
index b29d09c7f6a5a7f9621fb5287eb07e72ece7f484..9c5e1cd950c8d1d97290a047fb3780482f8eb8b7 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -79,7 +79,7 @@ static void compile_pcre_regexp(struct grep_pat *p, const struct grep_opt *opt)
 {
        const char *error;
        int erroffset;
-       int options = 0;
+       int options = PCRE_MULTILINE;
 
        if (opt->ignore_case)
                options |= PCRE_CASELESS;
index 80e0e8c051ad26a3a1353a4beb21e5c6ebdd6823..12e8318dc6a690d159751803003a2fce4c9ab94c 100644 (file)
@@ -41,28 +41,6 @@ struct store_conf {
        unsigned trash_remote_new:1, trash_only_new:1;
 };
 
-struct string_list {
-       struct string_list *next;
-       char string[1];
-};
-
-struct channel_conf {
-       struct channel_conf *next;
-       char *name;
-       struct store_conf *master, *slave;
-       char *master_name, *slave_name;
-       char *sync_state;
-       struct string_list *patterns;
-       int mops, sops;
-       unsigned max_messages; /* for slave only */
-};
-
-struct group_conf {
-       struct group_conf *next;
-       char *name;
-       struct string_list *channels;
-};
-
 /* For message->status */
 #define M_RECENT       (1<<0) /* unsyncable flag; maildir_* depend on this being 1<<0 */
 #define M_DEAD         (1<<1) /* expunged */
@@ -70,7 +48,6 @@ struct group_conf {
 
 struct message {
        struct message *next;
-       /* struct string_list *keywords; */
        size_t size; /* zero implies "not fetched" */
        int uid;
        unsigned char flags, status;
index dbb2623d930e433111f7e125749f5f1071e9ab3c..51f3045ba4bde549b06ea669b1877f0e2db7c401 100755 (executable)
@@ -159,6 +159,16 @@ test_expect_success 'relative paths' '
        (cd b && attr_check ../a/b/g a/b/g)
 '
 
+test_expect_success 'prefixes are not confused with leading directories' '
+       attr_check a_plus/g unspecified &&
+       cat >expect <<-\EOF &&
+       a/g: test: a/g
+       a_plus/g: test: unspecified
+       EOF
+       git check-attr test a/g a_plus/g >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success 'core.attributesfile' '
        attr_check global unspecified &&
        git config core.attributesfile "$HOME/global-gitattributes" &&
index 58a329961e5c269e1b035558db890c9e30375147..25435290a71ae8031762a3e63537fd3a23a8fc90 100755 (executable)
@@ -41,7 +41,7 @@ test_expect_success 'cannot commit with i-t-a entry' '
        echo frotz >nitfol &&
        git add rezrov &&
        git add -N nitfol &&
-       test_must_fail git commit
+       test_must_fail git commit -m initial
 '
 
 test_expect_success 'can commit with an unrelated i-t-a entry in index' '
index fbc8cd8f05f4debeb30b935c1b1db86e94e49f0e..af5134b70c6b4898aa652907d58191d45aa30ac4 100755 (executable)
@@ -47,6 +47,14 @@ test_expect_success \
     'git diff-index --cached $tree -- path1/ >current &&
      compare_diff_raw current expected'
 
+cat >expected <<\EOF
+:100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M     path1/file1
+EOF
+test_expect_success \
+    '"*file1" should show path1/file1' \
+    'git diff-index --cached $tree -- "*file1" >current &&
+     compare_diff_raw current expected'
+
 cat >expected <<\EOF
 :100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M     file0
 EOF
index d7d9ccc1c8c31ef3b2d4763532344d0637a18b5c..03eee07ffb3bcbcac3090eeb3a58e5dcbb66307f 100755 (executable)
@@ -495,4 +495,14 @@ test_expect_success 'am -q is quiet' '
        ! test -s output.out
 '
 
+test_expect_success 'am empty-file does not infloop' '
+       rm -fr .git/rebase-apply &&
+       git reset --hard &&
+       touch empty-file &&
+       test_tick &&
+       { git am empty-file > actual 2>&1 && false || :; } &&
+       echo Patch format detection failed. >expected &&
+       test_cmp expected actual
+'
+
 test_done