Merge branch 'bw/diff-color-hunk-header'
authorJunio C Hamano <gitster@pobox.com>
Mon, 30 Nov 2009 22:34:45 +0000 (14:34 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Nov 2009 22:34:45 +0000 (14:34 -0800)
Documentation/RelNotes-1.6.6.txt
Makefile
builtin-apply.c
color.h
t/README
t/t2300-cd-to-toplevel.sh
t/t3409-rebase-preserve-merges.sh
t/t4107-apply-ignore-whitespace.sh
t/t4128-apply-root.sh
t/t7406-submodule-update.sh
t/t9150-svk-mergetickets.sh
index 371101d667935d2e14a04452b98fdd6db1c6a08a..6163b4aad33ba07f41546a2464ea542e434c01a6 100644 (file)
@@ -1,39 +1,97 @@
 Git v1.6.6 Release Notes
 ========================
 
-In this release, "git fsck" defaults to "git fsck --full" and checks
-packfiles, and because of this it will take much longer to complete
-than before.  If you prefer a quicker check only on loose objects (the
-old default), you can say "git fsck --no-full".  This has been
-supported by 1.5.4 and newer versions of git, so it is safe to write
-it in your script even if you use slightly older git on some of your
-machines.
+Notes on behaviour change
+-------------------------
+
+ * In this release, "git fsck" defaults to "git fsck --full" and
+   checks packfiles, and because of this it will take much longer to
+   complete than before.  If you prefer a quicker check only on loose
+   objects (the old default), you can say "git fsck --no-full".  This
+   has been supported by 1.5.4 and newer versions of git, so it is
+   safe to write it in your script even if you use slightly older git
+   on some of your machines.
+
+Preparing yourselves for compatibility issues in 1.7.0
+------------------------------------------------------
+
+In git 1.7.0, which is planned to be the release after 1.6.6, there will
+be a handful of behaviour changes that will break backward compatibility.
+
+These changes were discussed long time ago and existing behaviours have
+been identified as more problematic to the userbase than keeping them for
+the sake of backward compatibility.
+
+When necessary, transition strategy for existing users has been designed
+not to force them running around setting configuration variables and
+updating their scripts in order to keep the traditional behaviour on the
+day their sysadmin decides to install the new version of git.  When we
+switched from "git-foo" to "git foo" in 1.6.0, even though the change had
+been advertised and the transition guide had been provided for a very long
+time, the users procrastinated during the entire transtion period, and
+ended up panicking on the day their sysadmins updated their git.
+
+For changes decided to be in 1.7.0, we have been much louder to strongly
+discourage such procrastination.  If you have been using recent versions
+of git, you would have already seen warnings issued when you exercised
+features whose behaviour will change, with the instruction on how to keep
+the existing behaviour if you choose to.  You hopefully should be well
+prepared already.
+
+Of course, we have also given "this and that will change in 1.7.0; prepare
+yourselves" warnings in the release notes and announcement messages.
+Let's see how well users will fare this time.
+
+ * "git push" into a branch that is currently checked out (i.e. pointed by
+   HEAD in a repository that is not bare) will be refused by default.
+
+   Similarly, "git push $there :$killed" to delete the branch $killed
+   in a remote repository $there, when $killed branch is the current
+   branch pointed at by its HEAD, will be refused by default.
+
+   Setting the configuration variables receive.denyCurrentBranch and
+   receive.denyDeleteCurrent to 'ignore' in the receiving repository
+   can be used to override these safety features.  Versions of git
+   since 1.6.2 have issued a loud warning when you tried to do them
+   without setting the configuration, so repositories of people who
+   still need to be able to perform such a push should already been
+   future proofed.
+
+   Please refer to:
+
+   http://git.or.cz/gitwiki/GitFaq#non-bare
+   http://thread.gmane.org/gmane.comp.version-control.git/107758/focus=108007
+
+   for more details on the reason why this change is needed and the
+   transition process that already took place so far.
+
+ * "git send-email" will not make deep threads by default when sending a
+   patch series with more than two messages.  All messages will be sent as
+   a reply to the first message, i.e. cover letter.  It has been possible
+   to configure send-email to do this by setting sendemail.chainreplyto
+   configuration variable to false.  The only thing the new release will
+   do is to change the default when you haven't configured that variable.
+
+ * "git status" will not be "git commit --dry-run".  This change does not
+   affect you if you run the command without pathspec.
+
+   Nobody sane found the current behaviour of "git status Makefile" useful
+   nor meaningful, and it confused users.  "git commit --dry-run" has been
+   provided as a way to get the current behaviour of this command since
+   1.6.5.
+
+ * "git diff" traditionally treated various "ignore whitespace" options
+   only as a way to filter the patch output.  "git diff --exit-code -b"
+   exited with non-zero status even if all changes were about changing the
+   ammount of whitespace and nothing else.  and "git diff -b" showed the
+   "diff --git" header line for such a change without patch text.
+
+   In 1.7.0, the "ignore whitespaces" will affect the semantics of the
+   diff operation itself.  A change that does not affect anything but
+   whitespaces will be reported with zero exit status when run with
+   --exit-code, and there will not be "diff --git" header for such a
+   change.
 
-In git 1.7.0, which is planned to be the release after 1.6.6, "git
-push" into a branch that is currently checked out will be refused by
-default.
-
-You can choose what should happen upon such a push by setting the
-configuration variable receive.denyCurrentBranch in the receiving
-repository.
-
-Also, "git push $there :$killed" to delete the branch $killed in a remote
-repository $there, when $killed branch is the current branch pointed at by
-its HEAD, will be refused by default.
-
-You can choose what should happen upon such a push by setting the
-configuration variable receive.denyDeleteCurrent in the receiving
-repository.
-
-To ease the transition plan, the receiving repository of such a
-push running this release will issue a big warning when the
-configuration variable is missing.  Please refer to:
-
-  http://git.or.cz/gitwiki/GitFaq#non-bare
-  http://thread.gmane.org/gmane.comp.version-control.git/107758/focus=108007
-
-for more details on the reason why this change is needed and the
-transition plan.
 
 Updates since v1.6.5
 --------------------
@@ -76,6 +134,12 @@ Updates since v1.6.5
  * "git diff" learned --submodule option to show a list of one-line logs
    instead of differences between the commit object names.
 
+ * "git fetch" learned --all and --multiple options, to run fetch from
+   many repositories, and --prune option to remove remote tracking
+   branches that went stale.  These make "git remote update" and "git
+   remote prune" less necessary (there is no plan to remove "remote
+   update" nor "remote prune", though).
+
  * "git fsck" by default checks the packfiles (i.e. "--full" is the
    default); you can turn it off with "git fsck --no-full".
 
@@ -88,6 +152,9 @@ Updates since v1.6.5
 
  * "git log --decorate" shows the location of HEAD as well.
 
+ * "git log" and "git rev-list" learned to take revs and pathspecs from
+   the standard input with the new "--stdin" option.
+
  * "--pretty=format" option to "log" family of commands learned:
 
    . to wrap text with the "%w()" specifier.
@@ -125,5 +192,5 @@ release, unless otherwise noted.
 ---
 exec >/var/tmp/1
 echo O=$(git describe master)
-O=v1.6.5.3-337-gf341feb
+O=v1.6.6-rc0-62-g7fc9d15
 git shortlog --no-merges $O..master --not maint
index 5a0b3d4a7b7c352f73be60ec254cad768040ee60..4dba10e7f06d816741697356f402e2a2b5da3dbe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1874,7 +1874,7 @@ distclean: clean
        $(RM) configure
 
 clean:
-       $(RM) *.o block-sha1/*.o arm/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o \
+       $(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o \
                $(LIB_FILE) $(XDIFF_LIB)
        $(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
        $(RM) $(TEST_PROGRAMS)
index f667368d161609ea3c93fc6ebe2452b9cd0e557d..36e2f9dda5c85c346e31f45afa6d28b107679970 100644 (file)
@@ -823,12 +823,13 @@ static int gitdiff_unrecognized(const char *line, struct patch *patch)
 
 static const char *stop_at_slash(const char *line, int llen)
 {
+       int nslash = p_value;
        int i;
 
        for (i = 0; i < llen; i++) {
                int ch = line[i];
-               if (ch == '/')
-                       return line + i;
+               if (ch == '/' && --nslash <= 0)
+                       return &line[i];
        }
        return NULL;
 }
diff --git a/color.h b/color.h
index 7d8da6fe2207ae4adb7ab888edd57ab571665458..3cb4b7fc890880b0fcf19a11c6bc7de6b10d6e8d 100644 (file)
--- a/color.h
+++ b/color.h
@@ -4,6 +4,11 @@
 /* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */
 #define COLOR_MAXLEN 24
 
+/*
+ * IMPORTANT: Due to the way these color codes are emulated on Windows,
+ * write them only using printf(), fprintf(), and fputs(). In particular,
+ * do not use puts() or write().
+ */
 #define GIT_COLOR_NORMAL       ""
 #define GIT_COLOR_RESET                "\033[m"
 #define GIT_COLOR_BOLD         "\033[1m"
index d8f6c7de6d27e27a33982e82893baa3bb5ffd7fd..4e1d7dd1833f43404a00b41d55800b9fe27d1807 100644 (file)
--- a/t/README
+++ b/t/README
@@ -75,6 +75,19 @@ appropriately before running "make".
        As the names depend on the tests' file names, it is safe to
        run the tests with this option in parallel.
 
+You can also set the GIT_TEST_INSTALLED environment variable to
+the bindir of an existing git installation to test that installation.
+You still need to have built this git sandbox, from which various
+test-* support programs, templates, and perl libraries are used.
+If your installed git is incomplete, it will silently test parts of
+your built version instead.
+
+When using GIT_TEST_INSTALLED, you can also set GIT_TEST_EXEC_PATH to
+override the location of the dashed-form subcommands (what
+GIT_EXEC_PATH would be used for during normal operation).
+GIT_TEST_EXEC_PATH defaults to `$GIT_TEST_INSTALLED/git --exec-path`.
+
+
 Skipping Tests
 --------------
 
index 3b01ad2e4de152d23bbe8267d3b1a5cafd615e88..9965bc5c92445160895ae3ea426c5caf1b3458b3 100755 (executable)
@@ -8,7 +8,7 @@ test_cd_to_toplevel () {
        test_expect_success $3 "$2" '
                (
                        cd '"'$1'"' &&
-                       . git-sh-setup &&
+                       . "$(git --exec-path)"/git-sh-setup &&
                        cd_to_toplevel &&
                        [ "$(pwd -P)" = "$TOPLEVEL" ]
                )
index 297d165476b93e18b18bf42bc81f4740cf18db9f..8f785e7957519eaa3dd1ef946c905054c4fa0e6c 100755 (executable)
@@ -32,14 +32,14 @@ export GIT_AUTHOR_EMAIL
 test_expect_success 'setup for merge-preserving rebase' \
        'echo First > A &&
        git add A &&
-       git-commit -m "Add A1" &&
+       git commit -m "Add A1" &&
        git checkout -b topic &&
        echo Second > B &&
        git add B &&
-       git-commit -m "Add B1" &&
+       git commit -m "Add B1" &&
        git checkout -f master &&
        echo Third >> A &&
-       git-commit -a -m "Modify A2" &&
+       git commit -a -m "Modify A2" &&
 
        git clone ./. clone1 &&
        cd clone1 &&
index 484654d6e49a170975a36efe9c27d7884c4bce5d..b04fc8fc12238c3326306ed0e055b7d67bf950b4 100755 (executable)
@@ -136,37 +136,37 @@ void print_int(int num) {
 EOF
 
 test_expect_success 'file creation' '
-       git-apply patch1.patch
+       git apply patch1.patch
 '
 
 test_expect_success 'patch2 fails (retab)' '
-       test_must_fail git-apply patch2.patch
+       test_must_fail git apply patch2.patch
 '
 
 test_expect_success 'patch2 applies with --ignore-whitespace' '
-       git-apply --ignore-whitespace patch2.patch
+       git apply --ignore-whitespace patch2.patch
 '
 
 test_expect_success 'patch2 reverse applies with --ignore-space-change' '
-       git-apply -R --ignore-space-change patch2.patch
+       git apply -R --ignore-space-change patch2.patch
 '
 
 git config apply.ignorewhitespace change
 
 test_expect_success 'patch2 applies (apply.ignorewhitespace = change)' '
-       git-apply patch2.patch
+       git apply patch2.patch
 '
 
 test_expect_success 'patch3 fails (missing string at EOL)' '
-       test_must_fail git-apply patch3.patch
+       test_must_fail git apply patch3.patch
 '
 
 test_expect_success 'patch4 fails (missing EOL at EOF)' '
-       test_must_fail git-apply patch4.patch
+       test_must_fail git apply patch4.patch
 '
 
 test_expect_success 'patch5 applies (leading whitespace)' '
-       git-apply patch5.patch
+       git apply patch5.patch
 '
 
 test_expect_success 'patches do not mangle whitespace' '
@@ -175,11 +175,11 @@ test_expect_success 'patches do not mangle whitespace' '
 
 test_expect_success 're-create file (with --ignore-whitespace)' '
        rm -f main.c &&
-       git-apply patch1.patch
+       git apply patch1.patch
 '
 
 test_expect_success 'patch5 fails (--no-ignore-whitespace)' '
-       test_must_fail git-apply --no-ignore-whitespace patch5.patch
+       test_must_fail git apply --no-ignore-whitespace patch5.patch
 '
 
 test_done
index 8f6aea48d84621ae3b7304636452c724a4bbe5b6..6cc741a634b0352c54fe8e5f61f1e99543909b8c 100755 (executable)
@@ -57,6 +57,23 @@ test_expect_success 'apply --directory (new file)' '
        test content = $(cat some/sub/dir/newfile)
 '
 
+cat > patch << EOF
+diff --git a/c/newfile2 b/c/newfile2
+new file mode 100644
+index 0000000..d95f3ad
+--- /dev/null
++++ b/c/newfile2
+@@ -0,0 +1 @@
++content
+EOF
+
+test_expect_success 'apply --directory -p (new file)' '
+       git reset --hard initial &&
+       git apply -p2 --directory=some/sub/dir/ --index patch &&
+       test content = $(git show :some/sub/dir/newfile2) &&
+       test content = $(cat some/sub/dir/newfile2)
+'
+
 cat > patch << EOF
 diff --git a/delfile b/delfile
 deleted file mode 100644
index 2d33d9efec3f2f601305e736e31368621acd0584..8e2449d24409bab14558f83617f651c3f7255627 100755 (executable)
@@ -14,8 +14,8 @@ submodule and "git submodule update --rebase/--merge" does not detach the HEAD.
 
 compare_head()
 {
-    sha_master=`git-rev-list --max-count=1 master`
-    sha_head=`git-rev-list --max-count=1 HEAD`
+    sha_master=`git rev-list --max-count=1 master`
+    sha_head=`git rev-list --max-count=1 HEAD`
 
     test "$sha_master" = "$sha_head"
 }
index dd0c2bad24db26abdab7a91acee109978421ea3e..53581425c4b5cd8e7b35b41605511d52d005e8d6 100755 (executable)
@@ -18,7 +18,7 @@ test_expect_success 'load svk depot' "
 uuid=b48289b2-9c08-4d72-af37-0358a40b9c15
 
 test_expect_success 'svk merges were represented coming in' "
-       [ `git-cat-file commit HEAD | grep parent | wc -l` -eq 2 ]
+       [ `git cat-file commit HEAD | grep parent | wc -l` -eq 2 ]
        "
 
 test_done