Merge branch 'jc/rebase'
authorJunio C Hamano <junkio@cox.net>
Wed, 15 Feb 2006 01:49:00 +0000 (17:49 -0800)
committerJunio C Hamano <junkio@cox.net>
Wed, 15 Feb 2006 01:49:00 +0000 (17:49 -0800)
* jc/rebase:
  rebase: allow a hook to refuse rebasing.

Documentation/git-commit.txt
Documentation/git-ls-files.txt
Documentation/git-send-email.txt
Makefile
git-bisect.sh
git-commit.sh
git-send-email.perl

index 53b64fa..214ed23 100644 (file)
@@ -8,8 +8,8 @@ git-commit - Record your changes
 SYNOPSIS
 --------
 [verse]
-'git-commit' [-a] [-i] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]
-          [-e] [--author <author>] [--] <file>...
+'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]
+          [-e] [--author <author>] [--] [[-i | -o ]<file>...]
 
 DESCRIPTION
 -----------
@@ -73,15 +73,20 @@ OPTIONS
        commit the whole index.  This is the traditional
        behaviour.
 
---::
-       Do not interpret any more arguments as options.
-
-<file>...::
+-o|--only::
        Commit only the files specified on the command line.
        This format cannot be used during a merge, nor when the
        index and the latest commit does not match on the
        specified paths to avoid confusion.
 
+--::
+       Do not interpret any more arguments as options.
+
+<file>...::
+       Files to be committed.  The meaning of these is
+       different between `--include` and `--only`.  Without
+       either, it defaults `--only` semantics.
+
 If you make a commit and then found a mistake immediately after
 that, you can recover from it with gitlink:git-reset[1].
 
index e433407..fe53412 100644 (file)
@@ -80,7 +80,7 @@ OPTIONS
        R::     removed/deleted
        C::     modified/changed
        K::     to be killed
-       ?       other
+       ?::     other
 
 --full-name::
        When run from a subdirectory, the command usually
index 00537d8..8c58685 100644 (file)
@@ -24,6 +24,9 @@ OPTIONS
 -------
 The options available are:
 
+--cc::
+       Specify a starting "Cc:" value for each email.
+
 --chain-reply-to, --no-chain-reply-to::
        If this is set, each email will be sent as a reply to the previous
        email sent.  If disabled with "--no-chain-reply-to", all emails after
@@ -48,6 +51,9 @@ The options available are:
        Only necessary if --compose is also set.  If --compose
        is not set, this will be prompted for.
 
+--no-signed-off-by-cc::
+       Do not add emails foudn in Signed-off-by: lines to the cc list.
+
 --quiet::
        Make git-send-email less verbose.  One line per email should be
        all that is output.
@@ -61,6 +67,10 @@ The options available are:
        Only necessary if --compose is also set.  If --compose
        is not set, this will be prompted for.
 
+--suppress-from::
+       Do not add the From: address to the cc: list, if it shows up in a From:
+       line.
+
 --to::
        Specify the primary recipient of the emails generated.
        Generally, this will be the upstream maintainer of the
index f240e45..d40aa6a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -67,7 +67,7 @@ all:
 # change being considered an inode change from the update-cache perspective.
 
 GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
-       @$(SHELL) ./GIT-VERSION-GEN
+       @$(SHELL_PATH) ./GIT-VERSION-GEN
 -include GIT-VERSION-FILE
 
 # CFLAGS and LDFLAGS are for the users to override from the command line.
index 51e1e44..03df143 100755 (executable)
@@ -49,9 +49,16 @@ bisect_start() {
        die "Bad HEAD - I need a symbolic ref"
        case "$head" in
        refs/heads/bisect*)
-               git checkout master || exit
+               if [ -s "$GIT_DIR/head-name" ]; then
+                   branch=`cat "$GIT_DIR/head-name"`
+               else
+                   branch=master
+               fi
+               git checkout $branch || exit
                ;;
        refs/heads/*)
+               [ -s "$GIT_DIR/head-name" ] && die "won't bisect on seeked tree"
+               echo "$head" | sed 's#^refs/heads/##' >"$GIT_DIR/head-name"
                ;;
        *)
                die "Bad HEAD - strange symbolic ref"
@@ -159,7 +166,11 @@ bisect_visualize() {
 
 bisect_reset() {
        case "$#" in
-       0) branch=master ;;
+       0) if [ -s "$GIT_DIR/head-name" ]; then
+              branch=`cat "$GIT_DIR/head-name"`
+          else
+              branch=master
+          fi ;;
        1) test -f "$GIT_DIR/refs/heads/$1" || {
               echo >&2 "$1 does not seem to be a valid branch"
               exit 1
@@ -170,8 +181,9 @@ bisect_reset() {
        esac
        git checkout "$branch" &&
        rm -fr "$GIT_DIR/refs/bisect"
-       rm -f "$GIT_DIR/refs/heads/bisect"
+       rm -f "$GIT_DIR/refs/heads/bisect" "$GIT_DIR/head-name"
        rm -f "$GIT_DIR/BISECT_LOG"
+       rm -f "$GIT_DIR/BISECT_NAMES"
 }
 
 bisect_replay () {
index 59551d9..ab5e6bc 100755 (executable)
@@ -3,7 +3,7 @@
 # Copyright (c) 2005 Linus Torvalds
 # Copyright (c) 2006 Junio C Hamano
 
-USAGE='[-a] [-i] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit>] [-e] [--author <author>] [<path>...]'
+USAGE='[-a] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit>] [-e] [--author <author>] [[-i | -o] <path>...]'
 SUBDIRECTORY_OK=Yes
 . git-sh-setup
 
@@ -340,11 +340,8 @@ case "$#,$also$only" in
 0,)
   ;;
 *,)
-  echo >&2 "assuming --include paths..."
-  also=t
-  # Later when switch the defaults, we will replace them with these:
-  # echo >&2 "assuming --only paths..."
-  # also=
+  echo >&2 "assuming --only paths..."
+  also=
 
   # If we are going to launch an editor, the message won't be
   # shown without this...
index 3f1b3ca..13b85dd 100755 (executable)
@@ -31,10 +31,10 @@ sub cleanup_compose_files();
 my $compose_filename = ".msg.$$";
 
 # Variables we fill in automatically, or via prompting:
-my (@to,@cc,$initial_reply_to,$initial_subject,@files,$from,$compose);
+my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose);
 
 # Behavior modification variables
-my ($chain_reply_to, $smtp_server, $quiet) = (1, "localhost", 0);
+my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, "localhost", 0, 0, 0);
 
 # Example reply to:
 #$initial_reply_to = ''; #<20050203173208.GA23964@foobar.com>';
@@ -48,10 +48,13 @@ my $rc = GetOptions("from=s" => \$from,
                     "in-reply-to=s" => \$initial_reply_to,
                    "subject=s" => \$initial_subject,
                    "to=s" => \@to,
+                   "cc=s" => \@initial_cc,
                    "chain-reply-to!" => \$chain_reply_to,
                    "smtp-server=s" => \$smtp_server,
                    "compose" => \$compose,
                    "quiet" => \$quiet,
+                   "suppress-from" => \$suppress_from,
+                   "no-signed-off-cc" => \$no_signed_off_cc,
         );
 
 # Now, let's fill any that aren't set in with defaults:
@@ -197,6 +200,9 @@ Options:
 
    --to           Specify the primary "To:" line of the email.
 
+   --cc           Specify an initial "Cc:" list for the entire series
+                  of emails.
+
    --compose      Use \$EDITOR to edit an introductory message for the
                   patch series.
 
@@ -212,13 +218,19 @@ Options:
                   email sent, rather than to the first email sent.
                   Defaults to on.
 
+   --no-signed-off-cc Suppress the automatic addition of email addresses
+                 that appear in a Signed-off-by: line, to the cc: list.
+                Note: Using this option is not recommended.
+
    --smtp-server  If set, specifies the outgoing SMTP server to use.
                   Defaults to localhost.
 
+  --suppress-from Supress sending emails to yourself if your address
+                  appears in a From: line.
+
    --quiet     Make git-send-email less verbose.  One line per email should be
                all that is output.
 
-
 Error: Please specify a file or a directory on the command line.
 EOT
        exit(1);
@@ -290,7 +302,7 @@ $subject = $initial_subject;
 foreach my $t (@files) {
        open(F,"<",$t) or die "can't open file $t";
 
-       @cc = ();
+       @cc = @initial_cc;
        my $found_mbox = 0;
        my $header_done = 0;
        $message = "";
@@ -304,6 +316,7 @@ foreach my $t (@files) {
                                        $subject = $1;
 
                                } elsif (/^(Cc|From):\s+(.*)$/) {
+                                       next if ($2 eq $from && $suppress_from);
                                        printf("(mbox) Adding cc: %s from line '%s'\n",
                                                $2, $_) unless $quiet;
                                        push @cc, $2;
@@ -332,7 +345,7 @@ foreach my $t (@files) {
                        }
                } else {
                        $message .=  $_;
-                       if (/^Signed-off-by: (.*)$/i) {
+                       if (/^Signed-off-by: (.*)$/i && !$no_signed_off_cc) {
                                my $c = $1;
                                chomp $c;
                                push @cc, $c;