diff options
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | builtin-add.c | 2 | ||||
-rw-r--r-- | builtin-apply.c | 2 | ||||
-rw-r--r-- | builtin-log.c | 3 | ||||
-rw-r--r-- | builtin-read-tree.c | 2 | ||||
-rw-r--r-- | builtin-rm.c | 2 | ||||
-rw-r--r-- | builtin-update-index.c | 2 | ||||
-rw-r--r-- | builtin-write-tree.c | 3 | ||||
-rw-r--r-- | checkout-index.c | 2 | ||||
-rw-r--r-- | diff.c | 10 | ||||
-rwxr-xr-x | git-bisect.sh | 2 | ||||
-rwxr-xr-x | git-clone.sh | 2 | ||||
-rwxr-xr-x | git-commit.sh | 2 | ||||
-rwxr-xr-x | git-cvsexportcommit.perl | 4 | ||||
-rwxr-xr-x | git-fetch.sh | 2 | ||||
-rwxr-xr-x | git-rebase.sh | 2 |
16 files changed, 29 insertions, 18 deletions
@@ -514,6 +514,7 @@ common-cmds.h: Documentation/git-*.txt $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh rm -f $@ $@+ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ + -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ -e 's/@@NO_PYTHON@@/$(NO_PYTHON)/g' \ @@ -552,9 +553,9 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ -e 's/@@NO_PYTHON@@/$(NO_PYTHON)/g' \ - -e '/@@GITWEB_CGI@@/rgitweb/gitweb.cgi' \ + -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \ -e '/@@GITWEB_CGI@@/d' \ - -e '/@@GITWEB_CSS@@/rgitweb/gitweb.css' \ + -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \ -e '/@@GITWEB_CSS@@/d' \ $@.sh > $@+ chmod +x $@+ diff --git a/builtin-add.c b/builtin-add.c index bfbbb1bf52..2d25698173 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -181,7 +181,7 @@ int cmd_add(int argc, const char **argv, char **envp) if (active_cache_changed) { if (write_cache(newfd, active_cache, active_nr) || - commit_lock_file(&lock_file)) + close(newfd) || commit_lock_file(&lock_file)) die("Unable to write new index file"); } diff --git a/builtin-apply.c b/builtin-apply.c index e9ead002d3..c3af48917c 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -2323,7 +2323,7 @@ int cmd_apply(int argc, const char **argv, char **envp) if (write_index) { if (write_cache(newfd, active_cache, active_nr) || - commit_lock_file(&lock_file)) + close(newfd) || commit_lock_file(&lock_file)) die("Unable to write new index file"); } diff --git a/builtin-log.c b/builtin-log.c index 698b71ecc8..0aeeaa4e20 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -105,6 +105,9 @@ static int git_format_config(const char *var, const char *value) strcat(extra_headers, value); return 0; } + if (!strcmp(var, "diff.color")) { + return 0; + } return git_diff_config(var, value); } diff --git a/builtin-read-tree.c b/builtin-read-tree.c index 9a2099d730..23a8d92a4b 100644 --- a/builtin-read-tree.c +++ b/builtin-read-tree.c @@ -1038,7 +1038,7 @@ int cmd_read_tree(int argc, const char **argv, char **envp) } if (write_cache(newfd, active_cache, active_nr) || - commit_lock_file(&lock_file)) + close(newfd) || commit_lock_file(&lock_file)) die("unable to write new index file"); return 0; } diff --git a/builtin-rm.c b/builtin-rm.c index 4d56a1f070..875d8252fa 100644 --- a/builtin-rm.c +++ b/builtin-rm.c @@ -147,7 +147,7 @@ int cmd_rm(int argc, const char **argv, char **envp) if (active_cache_changed) { if (write_cache(newfd, active_cache, active_nr) || - commit_lock_file(&lock_file)) + close(newfd) || commit_lock_file(&lock_file)) die("Unable to write new index file"); } diff --git a/builtin-update-index.c b/builtin-update-index.c index ef50243452..1a4200d151 100644 --- a/builtin-update-index.c +++ b/builtin-update-index.c @@ -648,7 +648,7 @@ int cmd_update_index(int argc, const char **argv, char **envp) finish: if (active_cache_changed) { if (write_cache(newfd, active_cache, active_nr) || - commit_lock_file(lock_file)) + close(newfd) || commit_lock_file(lock_file)) die("Unable to write new index file"); } diff --git a/builtin-write-tree.c b/builtin-write-tree.c index 70e9b6fcc6..449a4d1b57 100644 --- a/builtin-write-tree.c +++ b/builtin-write-tree.c @@ -35,7 +35,8 @@ int write_tree(unsigned char *sha1, int missing_ok, const char *prefix) missing_ok, 0) < 0) die("git-write-tree: error building trees"); if (0 <= newfd) { - if (!write_cache(newfd, active_cache, active_nr)) + if (!write_cache(newfd, active_cache, active_nr) + && !close(newfd)) commit_lock_file(lock_file); } /* Not being able to write is fine -- we are only interested diff --git a/checkout-index.c b/checkout-index.c index ea40bc29be..2927955508 100644 --- a/checkout-index.c +++ b/checkout-index.c @@ -311,7 +311,7 @@ int main(int argc, char **argv) if (0 <= newfd && (write_cache(newfd, active_cache, active_nr) || - commit_lock_file(&lock_file))) + close(newfd) || commit_lock_file(&lock_file))) die("Unable to write new index file"); return 0; } @@ -110,8 +110,14 @@ int git_diff_config(const char *var, const char *value) if (!strcmp(var, "diff.color")) { if (!value) diff_use_color_default = 1; /* bool */ - else if (!strcasecmp(value, "auto")) - diff_use_color_default = isatty(1); + else if (!strcasecmp(value, "auto")) { + diff_use_color_default = 0; + if (isatty(1)) { + char *term = getenv("TERM"); + if (term && strcmp(term, "dumb")) + diff_use_color_default = 1; + } + } else if (!strcasecmp(value, "never")) diff_use_color_default = 0; else if (!strcasecmp(value, "always")) diff --git a/git-bisect.sh b/git-bisect.sh index 03df1433ef..06a8d26945 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -13,7 +13,7 @@ git bisect log show bisect log.' . git-sh-setup sq() { - perl -e ' + @@PERL@@ -e ' for (@ARGV) { s/'\''/'\'\\\\\'\''/g; print " '\''$_'\''"; diff --git a/git-clone.sh b/git-clone.sh index 6a14b25911..0368803883 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -324,7 +324,7 @@ test -d "$GIT_DIR/refs/reference-tmp" && rm -fr "$GIT_DIR/refs/reference-tmp" if test -f "$GIT_DIR/CLONE_HEAD" then # Read git-fetch-pack -k output and store the remote branches. - perl -e "$copy_refs" "$GIT_DIR" "$use_separate_remote" "$origin" + @@PERL@@ -e "$copy_refs" "$GIT_DIR" "$use_separate_remote" "$origin" fi cd "$D" || exit diff --git a/git-commit.sh b/git-commit.sh index 22c4ce86c3..08d786db2f 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -147,7 +147,7 @@ run_status () { git-ls-files -z --others $option \ --exclude-per-directory=.gitignore fi | - perl -e '$/ = "\0"; + @@PERL@@ -e '$/ = "\0"; my $shown = 0; while (<>) { chomp; diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index d1051d074b..5dcb2f9a8e 100755 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@ -63,15 +63,15 @@ foreach my $p (@commit) { } if ($parent) { + my $found; # double check that it's a valid parent foreach my $p (@parents) { - my $found; if ($p eq $parent) { $found = 1; last; }; # found it - die "Did not find $parent in the parents for this commit!"; } + die "Did not find $parent in the parents for this commit!" if !$found; } else { # we don't have a parent from the cmdline... if (@parents == 1) { # it's safe to get it from the commit $parent = $parents[0]; diff --git a/git-fetch.sh b/git-fetch.sh index 48818f8224..f80299daaa 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -278,7 +278,7 @@ fetch_main () { head="ref: $remote_name" while (expr "z$head" : "zref:" && expr $depth \< $max_depth) >/dev/null do - remote_name_quoted=$(perl -e ' + remote_name_quoted=$(@@PERL@@ -e ' my $u = $ARGV[0]; $u =~ s/^ref:\s*//; $u =~ s{([^-a-zA-Z0-9/.])}{sprintf"%%%02x",ord($1)}eg; diff --git a/git-rebase.sh b/git-rebase.sh index 3945e06714..1b9e986926 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -311,7 +311,7 @@ echo "$prev_head" > "$dotest/prev_head" msgnum=0 for cmt in `git-rev-list --no-merges "$upstream"..ORIG_HEAD \ - | perl -e 'print reverse <>'` + | @@PERL@@ -e 'print reverse <>'` do msgnum=$(($msgnum + 1)) echo "$cmt" > "$dotest/cmt.$msgnum" |