Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Mon, 3 Mar 2008 07:59:50 +0000 (23:59 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Mar 2008 07:59:50 +0000 (23:59 -0800)
* maint:
Update draft release notes for 1.5.4.4
revert: actually check for a dirty index
tests: introduce test_must_fail
git-submodule: Fix typo 'url' which should be '$url'
receive-pack: Initialize PATH to include exec-dir.

Conflicts:

builtin-revert.c

Documentation/RelNotes-1.5.4.4.txt
builtin-revert.c
git-submodule.sh
receive-pack.c
t/t3501-revert-cherry-pick.sh
index 5bfdb35376858be5358be21832ff56f4eaa3e8b9..5635977c93b68b59f95c78058fecd8bd234b2693 100644 (file)
@@ -4,6 +4,10 @@ GIT v1.5.4.4 Release Notes
 Fixes since v1.5.4.3
 --------------------
 
+ * Building and installing with an overtight umask such as 077 made
+   installed templates unreadable by others, while the rest of the install
+   are done in a way that is friendly to umask 022.
+
  * "git cvsexportcommit -w $cvsdir" misbehaved when GIT_DIR is set to a
    relative directory.
 
@@ -17,10 +21,26 @@ Fixes since v1.5.4.3
 
  * "git send-email" in 1.5.4.3 issued a bogus empty In-Reply-To: header.
 
+ * "git bisect" showed mysterious "won't bisect on seeked tree" error message.
+   This was leftover from Cogito days to prevent "bisect" starting from a
+   cg-seeked state.  We still keep the Cogito safety, but running "git bisect
+   start" when another bisect was in effect will clean up and start over.
+
+ * "git push" with an explicit PATH to receive-pack did not quite work if
+   receive-pack was not on usual PATH.  We earlier fixed the same issue
+   with "git fetch" and upload-pack, but somehow forgot to do so in the
+   other direction.
+
+ * git-gui's info dialog was not displayed correctly when the user tries
+   to commit nothing (i.e. without staging anything).
+
+ * "git revert" did not properly fail when attempting to run with a
+   dirty index.
+
 Also included are a handful documentation updates.
 
 ---
 exec >/var/tmp/1
 echo O=$(git describe maint)
-O=v1.5.4.3
+O=v1.5.4.3-32-g0f2d447
 git shortlog --no-merges $O..maint
index b6dee6a56c21be816725a4366f448dac98e62ae6..607a2f0337c3d3f1fb8bdac7443e3a7f56e92305 100644 (file)
@@ -9,6 +9,8 @@
 #include "utf8.h"
 #include "parse-options.h"
 #include "cache-tree.h"
+#include "diff.h"
+#include "revision.h"
 
 /*
  * This implements the builtins revert and cherry-pick.
@@ -246,6 +248,17 @@ static char *help_msg(const unsigned char *sha1)
        return helpbuf;
 }
 
+static int index_is_dirty(void)
+{
+       struct rev_info rev;
+       init_revisions(&rev, NULL);
+       setup_revisions(0, NULL, &rev, "HEAD");
+       DIFF_OPT_SET(&rev.diffopt, QUIET);
+       DIFF_OPT_SET(&rev.diffopt, EXIT_WITH_STATUS);
+       run_diff_index(&rev, 1);
+       return !!DIFF_OPT_TST(&rev.diffopt, HAS_CHANGES);
+}
+
 static int revert_or_cherry_pick(int argc, const char **argv)
 {
        unsigned char head[20];
@@ -274,12 +287,11 @@ static int revert_or_cherry_pick(int argc, const char **argv)
                if (write_cache_as_tree(head, 0, NULL))
                        die ("Your index file is unmerged.");
        } else {
-               struct wt_status s;
-
                if (get_sha1("HEAD", head))
                        die ("You do not have a valid HEAD");
-               wt_status_prepare(&s);
-               if (s.commitable)
+               if (read_cache() < 0)
+                       die("could not read the index");
+               if (index_is_dirty())
                        die ("Dirty index: cannot %s", me);
                discard_cache();
        }
index a6aaf40b0ac5b477b73684b5a2b8b7417adaad81..67d3224c8c4c7106287aeb095ea545fe7a26b726 100755 (executable)
@@ -362,7 +362,7 @@ cmd_status()
        do
                name=$(module_name "$path") || exit
                url=$(git config submodule."$name".url)
-               if test -z "url" || ! test -d "$path"/.git
+               if test -z "$url" || ! test -d "$path"/.git
                then
                        say "-$sha1 $path"
                        continue;
index 0ca2a80bf00b76a2b07b749bb1ff7cb77d44f7ee..de7e18c49e5593f3e9251edd9def7639ac64a2c6 100644 (file)
@@ -481,6 +481,8 @@ int main(int argc, char **argv)
        if (!dir)
                usage(receive_pack_usage);
 
+       setup_path(NULL);
+
        if (!enter_repo(dir, 0))
                die("'%s': unable to chdir or not a git archive", dir);
 
index 2dbe04fb20aea9a18e6fe751539bcb48e5e7b4d3..6da212825a447866364979c2fb10778b6bbc02d5 100755 (executable)
@@ -59,4 +59,13 @@ test_expect_success 'revert after renaming branch' '
 
 '
 
+test_expect_success 'revert forbidden on dirty working tree' '
+
+       echo content >extra_file &&
+       git add extra_file &&
+       test_must_fail git revert HEAD 2>errors &&
+       grep "Dirty index" errors
+
+'
+
 test_done