Code

Merge branch 'ew/maint-svn-cert-fileprovider' into maint
authorJunio C Hamano <gitster@pobox.com>
Sat, 8 Mar 2008 10:11:32 +0000 (02:11 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 8 Mar 2008 10:11:32 +0000 (02:11 -0800)
* ew/maint-svn-cert-fileprovider:
  git-svn: Don't prompt for client cert password everytime.

32 files changed:
Documentation/RelNotes-1.5.4.4.txt [new file with mode: 0644]
Documentation/config.txt
Documentation/git-cherry-pick.txt
Documentation/git-merge.txt
Documentation/git-svn.txt
Documentation/technical/api-diff.txt
RelNotes
builtin-ls-remote.c
builtin-reflog.c
builtin-revert.c
contrib/emacs/git.el
git-bisect.sh
git-cvsexportcommit.perl
git-gui/Makefile
git-gui/lib/error.tcl
git-merge.sh
git-rebase--interactive.sh
git-send-email.perl
git-submodule.sh
http-push.c
http.c
quote.c
receive-pack.c
t/t2008-checkout-subdir.sh
t/t3501-revert-cherry-pick.sh
t/t5505-remote.sh
t/t6030-bisect-porcelain.sh
t/t7600-merge.sh
t/t9001-send-email.sh
t/t9200-git-cvsexportcommit.sh
t/test-lib.sh
templates/Makefile

diff --git a/Documentation/RelNotes-1.5.4.4.txt b/Documentation/RelNotes-1.5.4.4.txt
new file mode 100644 (file)
index 0000000..5635977
--- /dev/null
@@ -0,0 +1,46 @@
+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.
+
+ * "git http-push" had an invalid memory access that could lead it to
+   segfault.
+
+ * When "git rebase -i" gave control back to the user for a commit that is
+   marked to be edited, it just said "modify it with commit --amend",
+   without saying what to do to continue after modifying it.  Give an
+   explicit instruction to run "rebase --continue" to be more helpful.
+
+ * "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-32-g0f2d447
+git shortlog --no-merges $O..maint
index 6d8cca46ab934826a84647cbd6e441fee286f330..531ec46e957f85af2dfad69461ba81990500289e 100644 (file)
@@ -796,15 +796,15 @@ remote.<name>.skipDefaultUpdate::
 
 remote.<name>.receivepack::
        The default program to execute on the remote side when pushing.  See
-       option \--exec of linkgit:git-push[1].
+       option \--receive-pack of linkgit:git-push[1].
 
 remote.<name>.uploadpack::
        The default program to execute on the remote side when fetching.  See
-       option \--exec of linkgit:git-fetch-pack[1].
+       option \--upload-pack of linkgit:git-fetch-pack[1].
 
 remote.<name>.tagopt::
-       Setting this value to --no-tags disables automatic tag following when fetching
-       from remote <name>
+       Setting this value to \--no-tags disables automatic tag following when
+       fetching from remote <name>
 
 remotes.<group>::
        The list of remotes which are fetched by "git remote update
index 877ab66ef5c032af09ace5597bac64fd7739f468..f0beb412e655f0e188b8a1427b41f72b6cc61239 100644 (file)
@@ -45,7 +45,7 @@ OPTIONS
        default is not to do `-x` so this option is a no-op.
 
 -m parent-number|--mainline parent-number::
-       Usually you cannot revert a merge because you do not know which
+       Usually you cannot cherry-pick a merge because you do not know which
        side of the merge should be considered the mainline.  This
        option specifies the parent number (starting from 1) of
        the mainline and allows cherry-pick to replay the change
index 0c9ad7f2bbdf4872882d127804e7c474729c0818..c136b1069230af55b62ba95a1b40bdcc019b7b42 100644 (file)
@@ -68,7 +68,8 @@ HOW MERGE WORKS
 ---------------
 
 A merge is always between the current `HEAD` and one or more
-remote branch heads, and the index file must exactly match the
+commits (usually, branch head or tag), and the index file must
+exactly match the
 tree of `HEAD` commit (i.e. the contents of the last commit) when
 it happens.  In other words, `git-diff --cached HEAD` must
 report no changes.
index b1d527f74cd72a7c749f1067a91a6d2c6b6235d3..115b8bee0d762cefd4cd91c297830584cbc34a68 100644 (file)
@@ -159,6 +159,10 @@ New features:
        our version of --pretty=oneline
 --
 +
+NOTE: SVN itself only stores times in UTC and nothing else. The regular svn
+client converts the UTC time to the local time (or based on the TZ=
+environment). This command has the same behaviour.
++
 Any other arguments are passed directly to `git log'
 
 --
index 83b007e70876dec8ef0521ce40a682af79cc69d9..20b0241d30026747391fa4b6b38de5cf959cee70 100644 (file)
@@ -39,7 +39,7 @@ Calling sequence
 * Once you finish feeding the pairs of files, call `diffcore_std()`.
   This will tell the diffcore library to go ahead and do its work.
 
-* Calling `diffcore_flush()` will produce the output.
+* Calling `diff_flush()` will produce the output.
 
 
 Data structures
index 3084ce6946658475767c3098d79c60aff2bb7347..f84c4c7f11b0d2df58151efc5dcc01da4ebd4be6 120000 (symlink)
--- a/RelNotes
+++ b/RelNotes
@@ -1 +1 @@
-Documentation/RelNotes-1.5.4.3.txt
\ No newline at end of file
+Documentation/RelNotes-1.5.4.4.txt
\ No newline at end of file
index 6dd31d1dd6c14677f91e8a0a941fb0f873b4c1fc..720280e3900dc65a5063306a55880b8bc1330c2a 100644 (file)
@@ -94,10 +94,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
                transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack);
 
        ref = transport_get_remote_refs(transport);
-
-       if (!ref)
-               return 1;
-
        for ( ; ref; ref = ref->next) {
                if (!check_ref_type(ref, flags))
                        continue;
index 4836ec951be727512bcd550dd3604c43c39aa557..ab53c8cb7c08298c3ab0f69bf600a70385dafa64 100644 (file)
@@ -276,10 +276,11 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
        for_each_reflog_ent(ref, expire_reflog_ent, &cb);
  finish:
        if (cb.newlog) {
-               if (fclose(cb.newlog))
+               if (fclose(cb.newlog)) {
                        status |= error("%s: %s", strerror(errno),
                                        newlog_path);
-               if (rename(newlog_path, log_file)) {
+                       unlink(newlog_path);
+               } else if (rename(newlog_path, log_file)) {
                        status |= error("cannot rename %s to %s",
                                        newlog_path, log_file);
                        unlink(newlog_path);
index 358af537476b0b558989f27fe60627af6977635b..64f0d0ee028fd143ea065cad93ce7be03d94839d 100644 (file)
@@ -8,6 +8,8 @@
 #include "exec_cmd.h"
 #include "utf8.h"
 #include "parse-options.h"
+#include "diff.h"
+#include "revision.h"
 
 /*
  * This implements the builtins revert and cherry-pick.
@@ -245,6 +247,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];
@@ -273,12 +286,11 @@ static int revert_or_cherry_pick(int argc, const char **argv)
                if (write_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 d8a06381f4140a777f03fda67f68838e4aa3e493..0312d891fd1ddfe87f452611c24af7178313092e 100644 (file)
@@ -1432,7 +1432,7 @@ Commands:
         (with-current-buffer buffer
           (when (and list-buffers-directory
                      (string-equal fulldir (expand-file-name list-buffers-directory))
-                     (string-match "\\*git-status\\*$" (buffer-name buffer)))
+                    (eq major-mode 'git-status-mode))
             (setq found buffer))))
       (setq list (cdr list)))
     found))
index 6594a62919adcf2d1c524cc24435b6fe444f9d52..f8857747c4cc5cb3b958e925192e0040157ea911 100755 (executable)
@@ -67,16 +67,18 @@ bisect_start() {
        die "Bad HEAD - I need a HEAD"
        case "$head" in
        refs/heads/bisect)
-               if [ -s "$GIT_DIR/head-name" ]; then
-                   branch=`cat "$GIT_DIR/head-name"`
+               if [ -s "$GIT_DIR/BISECT_START" ]; then
+                   branch=`cat "$GIT_DIR/BISECT_START"`
                else
                    branch=master
                fi
                git checkout $branch || exit
                ;;
        refs/heads/*|$_x40)
+               # This error message should only be triggered by cogito usage,
+               # and cogito users should understand it relates to cg-seek.
                [ -s "$GIT_DIR/head-name" ] && die "won't bisect on seeked tree"
-               echo "${head#refs/heads/}" >"$GIT_DIR/head-name"
+               echo "${head#refs/heads/}" >"$GIT_DIR/BISECT_START"
                ;;
        *)
                die "Bad HEAD - strange symbolic ref"
@@ -353,8 +355,8 @@ bisect_reset() {
                return
        }
        case "$#" in
-       0) if [ -s "$GIT_DIR/head-name" ]; then
-              branch=`cat "$GIT_DIR/head-name"`
+       0) if [ -s "$GIT_DIR/BISECT_START" ]; then
+              branch=`cat "$GIT_DIR/BISECT_START"`
           else
               branch=master
           fi ;;
@@ -365,7 +367,9 @@ bisect_reset() {
            usage ;;
        esac
        if git checkout "$branch"; then
+               # Cleanup head-name if it got left by an old version of git-bisect
                rm -f "$GIT_DIR/head-name"
+               rm -f "$GIT_DIR/BISECT_START"
                bisect_clean_state
        fi
 }
index d2e50c34292bc0ccb6e914ed595da9fd8a7e141d..2a8ad1e9f4cbc2c21b83fd72fae1e0d2e582fbdc 100755 (executable)
@@ -5,6 +5,7 @@ use Getopt::Std;
 use File::Temp qw(tempdir);
 use Data::Dumper;
 use File::Basename qw(basename dirname);
+use File::Spec;
 
 our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u, $opt_w);
 
@@ -15,17 +16,15 @@ $opt_h && usage();
 die "Need at least one commit identifier!" unless @ARGV;
 
 if ($opt_w) {
+       # Remember where GIT_DIR is before changing to CVS checkout
        unless ($ENV{GIT_DIR}) {
-               # Remember where our GIT_DIR is before changing to CVS checkout
+               # No GIT_DIR set. Figure it out for ourselves
                my $gd =`git-rev-parse --git-dir`;
                chomp($gd);
-               if ($gd eq '.git') {
-                       my $wd = `pwd`;
-                       chomp($wd);
-                       $gd = $wd."/.git"       ;
-               }
                $ENV{GIT_DIR} = $gd;
        }
+       # Make sure GIT_DIR is absolute
+       $ENV{GIT_DIR} = File::Spec->rel2abs($ENV{GIT_DIR});
 
        if (! -d $opt_w."/CVS" ) {
                die "$opt_w is not a CVS checkout";
index 01e0a46ba56faa8a17ed8710346b18dd215899c7..4e321742ab8f103d829f33ab4d6ab5430fa132ba 100644 (file)
@@ -224,6 +224,11 @@ else
        ifeq ($(shell $(MSGFMT) >/dev/null 2>&1 || echo $$?),127)
                MSGFMT := $(TCL_PATH) po/po2msg.sh
        endif
+       ifeq (msgfmt,$(MSGFMT))
+       ifeq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null || echo $?),1)
+               MSGFMT := $(TCL_PATH) po/po2msg.sh
+       endif
+       endif
 endif
 
 msgsdir     = $(gg_libdir)/msgs
index 08a24622c7ff199399805ef34f0396f6cb81613c..8c27678e3a45c011cfc6a21f5d53b0d87c66b4a6 100644 (file)
@@ -47,7 +47,7 @@ proc info_popup {msg} {
                append title " ([reponame])"
        }
        tk_messageBox \
-               -parent $parent \
+               -parent [_error_parent] \
                -icon info \
                -type ok \
                -title $title \
index 1c123a37e6941b6727c6101bb29cbc485a380c20..03cd39873aef7b7ce00c4c2a826eab867ecc29ac 100755 (executable)
@@ -37,6 +37,7 @@ use_strategies=
 
 allow_fast_forward=t
 allow_trivial_merge=t
+squash= no_commit=
 
 dropsave() {
        rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
@@ -152,17 +153,21 @@ parse_config () {
                --summary)
                        show_diffstat=t ;;
                --squash)
-                       allow_fast_forward=t squash=t no_commit=t ;;
+                       test "$allow_fast_forward" = t ||
+                               die "You cannot combine --squash with --no-ff."
+                       squash=t no_commit=t ;;
                --no-squash)
-                       allow_fast_forward=t squash= no_commit= ;;
+                       squash= no_commit= ;;
                --commit)
-                       allow_fast_forward=t squash= no_commit= ;;
+                       no_commit= ;;
                --no-commit)
-                       allow_fast_forward=t squash= no_commit=t ;;
+                       no_commit=t ;;
                --ff)
-                       allow_fast_forward=t squash= no_commit= ;;
+                       allow_fast_forward=t ;;
                --no-ff)
-                       allow_fast_forward=false squash= no_commit= ;;
+                       test "$squash" != t ||
+                               die "You cannot combine --squash with --no-ff."
+                       allow_fast_forward=f ;;
                -s|--strategy)
                        shift
                        case " $all_strategies " in
index fb12b03b201836bb4c3b43a5d1120b3305d1ccf0..c2bedd622c7238359ab88592857bb50eeaa568f8 100755 (executable)
@@ -268,6 +268,10 @@ do_next () {
                warn
                warn "  git commit --amend"
                warn
+               warn "Once you are satisfied with your changes, run"
+               warn
+               warn "  git rebase --continue"
+               warn
                exit 0
                ;;
        squash|s)
index 8e6f3b22c83d25a46069c48c13a0eebbd2196ec2..e5d67f1b6c3237ff67673037be5ca8997cdb191d 100755 (executable)
@@ -166,7 +166,9 @@ my $envelope_sender;
 
 my $repo = Git->repository();
 my $term = eval {
-       new Term::ReadLine 'git-send-email';
+       $ENV{"GIT_SEND_EMAIL_NOTTY"}
+               ? new Term::ReadLine 'git-send-email', \*STDIN, \*STDOUT
+               : new Term::ReadLine 'git-send-email';
 };
 if ($@) {
        $term = new FakeTerm "$@: going non-interactive";
@@ -407,8 +409,9 @@ if ($thread && !defined $initial_reply_to && $prompting) {
        $initial_reply_to = $_;
 }
 if (defined $initial_reply_to) {
-       $initial_reply_to =~ s/^\s*<?/</;
-       $initial_reply_to =~ s/>?\s*$/>/;
+       $initial_reply_to =~ s/^\s*<?//;
+       $initial_reply_to =~ s/>?\s*$//;
+       $initial_reply_to = "<$initial_reply_to>" if $initial_reply_to ne '';
 }
 
 if (!defined $smtp_server) {
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 b2b410df902f2a4f2bca634d82cf103d288c9042..f9b77d6021cf8df4b4d7a7a1efea3e63b5dcb477 100644 (file)
@@ -1634,12 +1634,19 @@ static struct object_list **process_tree(struct tree *tree,
 
        init_tree_desc(&desc, tree->buffer, tree->size);
 
-       while (tree_entry(&desc, &entry)) {
-               if (S_ISDIR(entry.mode))
+       while (tree_entry(&desc, &entry))
+               switch (object_type(entry.mode)) {
+               case OBJ_TREE:
                        p = process_tree(lookup_tree(entry.sha1), p, &me, name);
-               else
+                       break;
+               case OBJ_BLOB:
                        p = process_blob(lookup_blob(entry.sha1), p, &me, name);
-       }
+                       break;
+               default:
+                       /* Subproject commit - not in this repository */
+                       break;
+               }
+
        free(tree->buffer);
        tree->buffer = NULL;
        return p;
@@ -2398,15 +2405,17 @@ int main(int argc, char **argv)
                fill_active_slots();
                add_fill_function(NULL, fill_active_slot);
 #endif
-               finish_all_active_slots();
+               do {
+                       finish_all_active_slots();
+#ifdef USE_CURL_MULTI
+                       fill_active_slots();
+#endif
+               } while (request_queue_head && !aborted);
 
                /* Update the remote branch if all went well */
-               if (aborted || !update_remote(ref->new_sha1, ref_lock)) {
+               if (aborted || !update_remote(ref->new_sha1, ref_lock))
                        rc = 1;
-                       goto unlock;
-               }
 
-       unlock:
                if (!rc)
                        fprintf(stderr, "    done\n");
                unlock_remote(ref_lock);
diff --git a/http.c b/http.c
index 5925d07478b763ee9f91d7b273f64f0ae956219b..c7deccb6de6a8a57a2fb57734f05d6ffdc6ae9dc 100644 (file)
--- a/http.c
+++ b/http.c
@@ -281,23 +281,15 @@ void http_init(void)
 void http_cleanup(void)
 {
        struct active_request_slot *slot = active_queue_head;
-#ifdef USE_CURL_MULTI
-       char *wait_url;
-#endif
 
        while (slot != NULL) {
                struct active_request_slot *next = slot->next;
+               if (slot->curl != NULL) {
 #ifdef USE_CURL_MULTI
-               if (slot->in_use) {
-                       curl_easy_getinfo(slot->curl,
-                                         CURLINFO_EFFECTIVE_URL,
-                                         &wait_url);
-                       fprintf(stderr, "Waiting for %s\n", wait_url);
-                       run_active_slot(slot);
-               }
+                       curl_multi_remove_handle(curlm, slot->curl);
 #endif
-               if (slot->curl != NULL)
                        curl_easy_cleanup(slot->curl);
+               }
                free(slot);
                slot = next;
        }
diff --git a/quote.c b/quote.c
index d061626c34f1e62c538db6e931c29751be4fdbcf..40702f6b725efade3e1fd61339421940f9fdb47d 100644 (file)
--- a/quote.c
+++ b/quote.c
@@ -288,7 +288,7 @@ int unquote_c_style(struct strbuf *sb, const char *quoted, const char **endp)
                switch (*quoted++) {
                  case '"':
                        if (endp)
-                               *endp = quoted + 1;
+                               *endp = quoted;
                        return 0;
                  case '\\':
                        break;
index 326749583221d0f5e81f58608a23ab1dc1601177..c90ec7dde28ec135f0c90e6c731b730ad4a1f7a8 100644 (file)
@@ -469,6 +469,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 f78945ed8e8fe5fea3c2656460a120363c546185..3e098ab31e1944abe8e5815c0f219947620b6618 100755 (executable)
@@ -67,16 +67,16 @@ test_expect_success 'checkout with simple prefix' '
 
 '
 
-test_expect_failure 'relative path outside tree should fail' \
-       'git checkout HEAD -- ../../Makefile'
+test_expect_success 'relative path outside tree should fail' \
+       'test_must_fail git checkout HEAD -- ../../Makefile'
 
-test_expect_failure 'incorrect relative path to file should fail (1)' \
-       'git checkout HEAD -- ../file0'
+test_expect_success 'incorrect relative path to file should fail (1)' \
+       'test_must_fail git checkout HEAD -- ../file0'
 
-test_expect_failure 'incorrect relative path should fail (2)' \
-       '( cd dir1 && git checkout HEAD -- ./file0 )'
+test_expect_success 'incorrect relative path should fail (2)' \
+       '( cd dir1 && test_must_fail git checkout HEAD -- ./file0 )'
 
-test_expect_failure 'incorrect relative path should fail (3)' \
-       '( cd dir1 && git checkout HEAD -- ../../file0 )'
+test_expect_success 'incorrect relative path should fail (3)' \
+       '( cd dir1 && test_must_fail git checkout HEAD -- ../../file0 )'
 
 test_done
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
index 636aec2f7139cad63591d64e8c89e82d2ed4760b..4fc62f550cbced0f1e257fa5057e43f4c54ed5dd 100755 (executable)
@@ -4,9 +4,6 @@ test_description='git remote porcelain-ish'
 
 . ./test-lib.sh
 
-GIT_CONFIG=.git/config
-export GIT_CONFIG
-
 setup_repository () {
        mkdir "$1" && (
        cd "$1" &&
index ec71123f4be187c1399c90dc806dbae53cda5b7f..4908e878fee48069fbdc339f17ad6e865111ae00 100755 (executable)
@@ -260,7 +260,7 @@ test_expect_success 'bisect starting with a detached HEAD' '
        git checkout master^ &&
        HEAD=$(git rev-parse --verify HEAD) &&
        git bisect start &&
-       test $HEAD = $(cat .git/head-name) &&
+       test $HEAD = $(cat .git/BISECT_START) &&
        git bisect reset &&
        test $HEAD = $(git rev-parse --verify HEAD)
 
index 50c51c82facdf30fffa4517763c84ce862aa8c27..5d166280cbb93ef4e22f04090d510bfd5b09fb7a 100755 (executable)
@@ -419,6 +419,7 @@ test_debug 'gitk --all'
 
 test_expect_success 'merge c0 with c1 (no-ff)' '
        git reset --hard c0 &&
+       git config branch.master.mergeoptions "" &&
        test_tick &&
        git merge --no-ff c1 &&
        verify_merge file result.1 &&
@@ -427,6 +428,11 @@ test_expect_success 'merge c0 with c1 (no-ff)' '
 
 test_debug 'gitk --all'
 
+test_expect_success 'combining --squash and --no-ff is refused' '
+       test_must_fail git merge --squash --no-ff c1 &&
+       test_must_fail git merge --no-ff --squash c1
+'
+
 test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '
        git reset --hard c0 &&
        git config branch.master.mergeoptions "--no-ff" &&
index 08f7c3d8d7666aeb7a116f475127c9c183e64d5a..2efaed441d6ae238ce5d6a6105230e088d5e56ff 100755 (executable)
@@ -108,4 +108,25 @@ test_expect_success 'allow long lines with --no-validate' '
                2>errors
 '
 
+test_expect_success 'Invalid In-Reply-To' '
+       git send-email \
+               --from="Example <nobody@example.com>" \
+               --to=nobody@example.com \
+               --in-reply-to=" " \
+               --smtp-server="$(pwd)/fake.sendmail" \
+               $patches
+               2>errors
+       ! grep "^In-Reply-To: < *>" msgtxt
+'
+
+test_expect_success 'Valid In-Reply-To when prompting' '
+       (echo "From Example <from@example.com>"
+        echo "To Example <to@example.com>"
+        echo ""
+       ) | env GIT_SEND_EMAIL_NOTTY=1 git send-email \
+               --smtp-server="$(pwd)/fake.sendmail" \
+               $patches 2>errors &&
+       ! grep "^In-Reply-To: < *>" msgtxt
+'
+
 test_done
index a15222ced4d75e70f49df08159cff9dd8d4167a4..49d57a81ec1cc55f83fb63436631dfdc7d647e0b 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # Copyright (c) Robin Rosenberg
 #
-test_description='CVS export comit. '
+test_description='Test export of commits to CVS'
 
 . ./test-lib.sh
 
@@ -246,4 +246,20 @@ test_expect_success \
        ;;
 esac
 
+test_expect_success '-w option should work with relative GIT_DIR' '
+      mkdir W &&
+      echo foobar >W/file1.txt &&
+      echo bazzle >W/file2.txt &&
+      git add W/file1.txt &&
+      git add W/file2.txt &&
+      git commit -m "More updates" &&
+      id=$(git rev-list --max-count=1 HEAD) &&
+      (cd "$GIT_DIR" &&
+      GIT_DIR=. git cvsexportcommit -w "$CVSWORK" -c $id &&
+      check_entries "$CVSWORK/W" "file1.txt/1.1/|file2.txt/1.1/" &&
+      diff -u "$CVSWORK/W/file1.txt" ../W/file1.txt &&
+      diff -u "$CVSWORK/W/file2.txt" ../W/file2.txt
+      )
+'
+
 test_done
index 142540e1b175e44da0d6e522140d404fb5a795bf..44f5776a1b30895e8d7b2d0601c8edc677790eeb 100644 (file)
@@ -3,12 +3,16 @@
 # Copyright (c) 2005 Junio C Hamano
 #
 
+# Keep the original TERM for say_color
+ORIGINAL_TERM=$TERM
+
 # For repeatability, reset the environment to known value.
 LANG=C
 LC_ALL=C
 PAGER=cat
 TZ=UTC
-export LANG LC_ALL PAGER TZ
+TERM=dumb
+export LANG LC_ALL PAGER TERM TZ
 EDITOR=:
 VISUAL=:
 unset GIT_EDITOR
@@ -58,12 +62,14 @@ esac
 # This test checks if command xyzzy does the right thing...
 # '
 # . ./test-lib.sh
-
-[ "x$TERM" != "xdumb" ] &&
-       [ -t 1 ] &&
-       tput bold >/dev/null 2>&1 &&
-       tput setaf 1 >/dev/null 2>&1 &&
-       tput sgr0 >/dev/null 2>&1 &&
+[ "x$ORIGINAL_TERM" != "xdumb" ] && (
+               TERM=$ORIGINAL_TERM &&
+               export TERM &&
+               [ -t 1 ] &&
+               tput bold >/dev/null 2>&1 &&
+               tput setaf 1 >/dev/null 2>&1 &&
+               tput sgr0 >/dev/null 2>&1
+       ) &&
        color=t
 
 while test "$#" -ne 0
@@ -91,6 +97,9 @@ done
 
 if test -n "$color"; then
        say_color () {
+               (
+               TERM=$ORIGINAL_TERM
+               export TERM
                case "$1" in
                        error) tput bold; tput setaf 1;; # bold red
                        skip)  tput bold; tput setaf 2;; # bold green
@@ -101,6 +110,7 @@ if test -n "$color"; then
                shift
                echo "* $*"
                tput sgr0
+               )
        }
 else
        say_color() {
@@ -257,6 +267,23 @@ test_expect_code () {
        echo >&3 ""
 }
 
+# This is not among top-level (test_expect_success | test_expect_failure)
+# but is a prefix that can be used in the test script, like:
+#
+#      test_expect_success 'complain and die' '
+#           do something &&
+#           do something else &&
+#          test_must_fail git checkout ../outerspace
+#      '
+#
+# Writing this as "! git checkout ../outerspace" is wrong, because
+# the failure could be due to a segv.  We want a controlled failure.
+
+test_must_fail () {
+       "$@"
+       test $? -gt 0 -a $? -le 128
+}
+
 # Most tests can use the created repository, but some may need to create more.
 # Usage: test_create_repo <directory>
 test_create_repo () {
index ebd3a62fd866453ad77406ec063b923e99ee0990..bda9d13505f9dbec8a7864d14c52bbb4827b4f52 100644 (file)
@@ -29,10 +29,10 @@ boilerplates.made : $(bpsrc)
                case "$$boilerplate" in *~) continue ;; esac && \
                dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
                dir=`expr "$$dst" : '\(.*\)/'` && \
-               mkdir -p blt/$$dir && \
+               $(INSTALL) -d -m 755 blt/$$dir && \
                case "$$boilerplate" in \
                *--) ;; \
-               *) cp $$boilerplate blt/$$dst ;; \
+               *) cp -p $$boilerplate blt/$$dst ;; \
                esac || exit; \
        done && \
        date >$@
@@ -48,4 +48,4 @@ clean:
 install: all
        $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_dir_SQ)'
        (cd blt && $(TAR) cf - .) | \
-       (cd '$(DESTDIR_SQ)$(template_dir_SQ)' && $(TAR) xf -)
+       (cd '$(DESTDIR_SQ)$(template_dir_SQ)' && umask 022 && $(TAR) xf -)