From 2bb10fe51eae9bf205513b6a1f9197d4599a8c03 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 23 Oct 2006 18:26:39 +0200 Subject: prune-packed: Fix uninitialized variable. The dryrun variable was made local instead of static by the previous commit, and local variables aren't initialized to zero. Signed-off-by: Alexandre Julliard Signed-off-by: Junio C Hamano --- builtin-prune-packed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-prune-packed.c b/builtin-prune-packed.c index e12b6cf599..24e3b0a8c2 100644 --- a/builtin-prune-packed.c +++ b/builtin-prune-packed.c @@ -56,7 +56,7 @@ void prune_packed_objects(int dryrun) int cmd_prune_packed(int argc, const char **argv, const char *prefix) { int i; - int dryrun; + int dryrun = 0; for (i = 1; i < argc; i++) { const char *arg = argv[i]; -- cgit v1.2.3 From 0cc6d3464a1944e930cfb12ba030eb1581323845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santi=20B=C3=A9jar?= Date: Mon, 23 Oct 2006 18:42:14 +0200 Subject: Documentation for the [remote] config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Santi BĂ©jar Signed-off-by: Junio C Hamano --- Documentation/config.txt | 12 ++++++++++++ Documentation/urls.txt | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/Documentation/config.txt b/Documentation/config.txt index 84e38911ee..ee51fe3b9f 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -230,6 +230,18 @@ pull.octopus:: pull.twohead:: The default merge strategy to use when pulling a single branch. +remote..url:: + The URL of a remote repository. See gitlink:git-fetch[1] or + gitlink:git-push[1]. + +remote..fetch:: + The default set of "refspec" for gitlink:git-fetch[1]. See + gitlink:git-fetch[1]. + +remote..push:: + The default set of "refspec" for gitlink:git-push[1]. See + gitlink:git-push[1]. + show.difftree:: The default gitlink:git-diff-tree[1] arguments to be used for gitlink:git-show[1]. diff --git a/Documentation/urls.txt b/Documentation/urls.txt index 26ecba53fb..670827c323 100644 --- a/Documentation/urls.txt +++ b/Documentation/urls.txt @@ -51,6 +51,14 @@ lines are used for `git-push` and `git-fetch`/`git-pull`, respectively. Multiple `Push:` and `Pull:` lines may be specified for additional branch mappings. +Or, equivalently, in the `$GIT_DIR/config` (note the use +of `fetch` instead of `Pull:`): + +[remote ""] + url = + push = + fetch = + The name of a file in `$GIT_DIR/branches` directory can be specified as an older notation short-hand; the named file should contain a single line, a URL in one of the -- cgit v1.2.3 From 810799ecab6f9164401416988d9d79270315ba18 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 23 Oct 2006 15:59:48 +0200 Subject: git-clone: honor --quiet I noticed that a cron-launched "git-clone --quiet" was generating progress output to standard error -- and thus always spamming me. The offending output was due to git-clone invoking git-read-tree with its undocumented -v option. This change turns off "-v" for --quiet. Signed-off-by: Jim Meyering Signed-off-by: Junio C Hamano --- git-clone.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-clone.sh b/git-clone.sh index bf54a11508..24b119537b 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -414,7 +414,8 @@ Pull: refs/heads/$head_points_at:$origin_track" && case "$no_checkout" in '') - git-read-tree -m -u -v HEAD HEAD + test "z$quiet" = z && v=-v || v= + git-read-tree -m -u $v HEAD HEAD esac fi rm -f "$GIT_DIR/CLONE_HEAD" "$GIT_DIR/REMOTE_HEAD" -- cgit v1.2.3 From 67aef034551aed0cc417e8b758a59b9978c4f3f1 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 23 Oct 2006 22:22:25 +0200 Subject: xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header. This removes trailing blanks from git-generated diff headers the same way a similar patch did that for GNU diff: http://article.gmane.org/gmane.comp.gnu.utils.bugs/13839 That is, it removes trailing blanks on the hunk header line that shows the function name. Signed-off-by: Jim Meyering Signed-off-by: Junio C Hamano --- xdiff/xemit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xdiff/xemit.c b/xdiff/xemit.c index 714c563547..154c26fdcd 100644 --- a/xdiff/xemit.c +++ b/xdiff/xemit.c @@ -90,7 +90,7 @@ static void xdl_find_func(xdfile_t *xf, long i, char *buf, long sz, long *ll) { *rec == '#')) { /* #define? */ if (len > sz) len = sz; - if (len && rec[len - 1] == '\n') + while (0 < len && isspace((unsigned char)rec[len - 1])) len--; memcpy(buf, rec, len); *ll = len; -- cgit v1.2.3 From 83543a24c316de60b886cd98272fde2bcc99d558 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 23 Oct 2006 18:26:05 -0700 Subject: daemon: do not die on older clients. In the older times, the clients did not say which host they were trying to connect, and the code we recently added did not quite handle the older clients correctly. Noticed by Simon Arlott. Signed-off-by: Junio C Hamano --- daemon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon.c b/daemon.c index ad8492873e..e66bb802da 100644 --- a/daemon.c +++ b/daemon.c @@ -450,6 +450,8 @@ void fill_in_extra_table_entries(struct interp *itable) * Replace literal host with lowercase-ized hostname. */ hp = interp_table[INTERP_SLOT_HOST].value; + if (!hp) + return; for ( ; *hp; hp++) *hp = tolower(*hp); @@ -544,8 +546,10 @@ static int execute(struct sockaddr *addr) loginfo("Extended attributes (%d bytes) exist <%.*s>", (int) pktlen - len, (int) pktlen - len, line + len + 1); - if (len && line[len-1] == '\n') + if (len && line[len-1] == '\n') { line[--len] = 0; + pktlen--; + } /* * Initialize the path interpolation table for this connection. -- cgit v1.2.3 From a153adf683d2b6e22c7e892ed8a161b140156186 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Tue, 24 Oct 2006 02:39:14 +0200 Subject: gitweb: Fix setting $/ in parse_commit() If the commit couldn't have been read, $/ wasn't restored to \n properly, causing random havoc like git_get_ref_list() returning the ref names with trailing \n. Aside of potential confusion in the body of git_search(), no other $/ surprises are hopefully hidden in the code. Signed-off-by: Petr Baudis Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 23b26a2db2..2390603e97 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1009,12 +1009,11 @@ sub parse_commit { if (defined $commit_text) { @commit_lines = @$commit_text; } else { - $/ = "\0"; + local $/ = "\0"; open my $fd, "-|", git_cmd(), "rev-list", "--header", "--parents", "--max-count=1", $commit_id or return; @commit_lines = split '\n', <$fd>; close $fd or return; - $/ = "\n"; pop @commit_lines; } my $header = shift @commit_lines; -- cgit v1.2.3