From c1f8064b143f98e8b3c5ff1ce12ebd0800df5d67 Mon Sep 17 00:00:00 2001 From: Yakov Lerner Date: Thu, 22 Jun 2006 04:47:00 +0300 Subject: [PATCH 1/4] Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used. Before this patch, -DDEFAULT_GIT_TEMPLATE_DIR was passed on compilation command line to all and every .c file compiled. In fact the macro is used by only one .c file, and unused by all other .c files. Remove -DDEFAULT_GIT_TEMPLATE_DIR where unused. Follow the example of exec_cmd.o. Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used. Signed-off-by: Yakov Lerner Signed-off-by: Junio C Hamano --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0887945ffa..55a84d478e 100644 --- a/Makefile +++ b/Makefile @@ -472,7 +472,6 @@ PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH)) GIT_PYTHON_DIR_SQ = $(subst ','\'',$(GIT_PYTHON_DIR)) ALL_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' $(COMPAT_CFLAGS) -ALL_CFLAGS += -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' LIB_OBJS += $(COMPAT_OBJS) export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir ### Build rules @@ -548,6 +547,8 @@ git$X git.spec \ exec_cmd.o: exec_cmd.c GIT-CFLAGS $(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' $< +builtin-init-db.o: builtin-init-db.c GIT-CFLAGS + $(CC) -o $*.o -c $(ALL_CFLAGS) -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' $< http.o: http.c GIT-CFLAGS $(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $< From 79ee555bac7a5ff846c8a381792bbe93cdffbf97 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Wed, 21 Jun 2006 07:17:31 -0600 Subject: [PATCH 2/4] Check and document the options to prevent mistakes. When multiple recipients are given to git-send-email on the same --cc line the code does not properly handle it. Full and proper parsing of the email addresses so I can detect which commas mean a new email address is more than I care to implement. In particular this email address: "bibo,mao" must not be treated as two email addresses. So this patch simply treats all commas in recipient lists as an error and fails if one is given. At the same time it documents that git-send-email wants multiple instances of --cc specified on the command line if you want to cc multiple recipients. Signed-off-by: Eric W. Biederman Signed-off-by: Junio C Hamano --- Documentation/git-send-email.txt | 9 +++++++++ git-send-email.perl | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt index ad1b9cf2e9..481b3f50e3 100644 --- a/Documentation/git-send-email.txt +++ b/Documentation/git-send-email.txt @@ -24,9 +24,16 @@ OPTIONS ------- The options available are: +--bcc:: + Specify a "Bcc:" value for each email. + + The --bcc option must be repeated for each user you want on the bcc list. + --cc:: Specify a starting "Cc:" value for each email. + The --cc option must be repeated for each user you want on the cc list. + --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 @@ -76,6 +83,8 @@ The options available are: Generally, this will be the upstream maintainer of the project involved. + The --to option must be repeated for each user you want on the to list. + Author ------ diff --git a/git-send-email.perl b/git-send-email.perl index 7b1cca70ab..c5d9e73351 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -65,6 +65,20 @@ my $rc = GetOptions("from=s" => \$from, "no-signed-off-cc|no-signed-off-by-cc" => \$no_signed_off_cc, ); +# Verify the user input + +foreach my $entry (@to) { + die "Comma in --to entry: $entry'\n" unless $entry !~ m/,/; +} + +foreach my $entry (@initial_cc) { + die "Comma in --cc entry: $entry'\n" unless $entry !~ m/,/; +} + +foreach my $entry (@bcclist) { + die "Comma in --bcclist entry: $entry'\n" unless $entry !~ m/,/; +} + # Now, let's fill any that aren't set in with defaults: sub gitvar { From bbc932c845ad17087ed601625f878adf5bae6e96 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 22 Jun 2006 02:04:27 -0700 Subject: [PATCH 3/4] Makefile: do not force unneeded recompilation upon GIT_VERSION changes Signed-off-by: Junio C Hamano --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 55a84d478e..d45f3dcf62 100644 --- a/Makefile +++ b/Makefile @@ -612,7 +612,7 @@ tags: find . -name '*.[hcS]' -print | xargs ctags -a ### Detect prefix changes -TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):$(GIT_VERSION):\ +TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):$(GIT_PYTHON_DIR_SQ):\ $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) GIT-CFLAGS: .FORCE-GIT-CFLAGS From ec9d00d078ed1625d8c85a25618dfa2aa8042b69 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 22 Jun 2006 01:22:46 -0700 Subject: [PATCH 4/4] git-svn: fix commit --edit flag when using SVN:: libraries Trying to open an interactive editor in the console while stdout is being piped to the parent process doesn't work out very well. Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- contrib/git-svn/git-svn.perl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl index 7e7f2f0cd9..08c30103f5 100755 --- a/contrib/git-svn/git-svn.perl +++ b/contrib/git-svn/git-svn.perl @@ -479,17 +479,18 @@ sub commit_lib { my @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef, 0) : (); my $commit_msg = "$GIT_SVN_DIR/.svn-commit.tmp.$$"; + if (defined $LC_ALL) { + $ENV{LC_ALL} = $LC_ALL; + } else { + delete $ENV{LC_ALL}; + } foreach my $c (@revs) { + my $log_msg = get_commit_message($c, $commit_msg); + # fork for each commit because there's a memory leak I # can't track down... (it's probably in the SVN code) defined(my $pid = open my $fh, '-|') or croak $!; if (!$pid) { - if (defined $LC_ALL) { - $ENV{LC_ALL} = $LC_ALL; - } else { - delete $ENV{LC_ALL}; - } - my $log_msg = get_commit_message($c, $commit_msg); my $ed = SVN::Git::Editor->new( { r => $r_last, ra => $SVN, @@ -535,6 +536,7 @@ sub commit_lib { ($r_last, $cmt_last) = ($r_new, $cmt_new); } } + $ENV{LC_ALL} = 'C'; unlink $commit_msg; }