Git development
 help / color / mirror / Atom feed
* Re: [PATCHv3 3/4 (resent)] gitweb: Optionally add "git" links in project list page
From: Jakub Narebski @ 2010-01-09 11:20 UTC (permalink / raw)
  To: J.H.; +Cc: git, John 'Warthog9' Hawley
In-Reply-To: <4B47E06C.9070503@eaglescrag.net>

On Sat, 9 Jan 2010, J.H. wrote:
> On 01/03/2010 08:07 AM, Jakub Narebski wrote:
> > From: John 'Warthog9' Hawley <warthog9@kernel.org>
> > 
> > This adds a "git" link for each project in the project list page,
> > should a common $gitlinkurl_base be defined and not empty.  The full
> > URL of each link is composed of $gitlinkurl_base and project name.
> > It is intended for git:// links, and in fact GITWEB_BASE_URL build
> > variable is used as its default value only if it starts with git://
> > 
> > This does make the assumption that the git repositories share a common
> > path.  Nothing to date is known to actually make use of introduced
> > link.
> > 
> > Created "git" link follows rel=vcs-* microformat specification:
> >   http://kitenet.net/~joey/rfc/rel-vcs/
> > 
> > Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org>
> > Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> > ---
> > I think it might be good idea... but for the fact "Nothing to date is
> > known to actually make use of introduced link".  What's its intended
> > use?
> > 
> > Differences to original version by John 'Warthog9' Hawley (J.H.):
> > * It doesn't cause syntax error ;-)
> > * Escaping of attribute value is left to CGI.pm (avoid double escaping)
> > * $gitlinkurl got renamed to $gitlinkurl_base, now includes git://
> >   prefix, and defaults to GITWEB_BASE_URL if it begins with git://
> > * Added description of $gitlinkurl_base to gitweb/README
> > * Uses rel=vcs-* microformat by Joey Hess

> >  gitweb/README      |    4 ++++
> >  gitweb/gitweb.perl |    8 ++++++++
> >  2 files changed, 12 insertions(+), 0 deletions(-)

A reminder - this patch series consists of the following patches:
 [PATCHv2 1/4 (resent)]     gitweb: Load checking
 [RFC/PATCHv2 2/4 (resent)] gitweb: Add option to force version match
 [PATCHv3 3/4 (resent)]     gitweb: Optionally add "git" links in project list page
 [PATCHv2/RFC 4/4 (resent)] gitweb: Makefile improvements

> Ok I've been debating this as I've been going through the patches, I've
> got small modifications on top of your patches Jakub for 1 and 2,
> haven't pushed them yet but they are relatively trivial.  The changes to
> the first patch sets things up for additional load checkers to be added
> later on.  

Good idea, although I think that such addition can be left for a separate
patch.  

By the way, are you doing if-elsif fallback chain, trying different
mechanisms (like '/proc/loadavg', BSD::getloadavg, etc.), or did
you made get_loadavg() into code reference, i.e. run it with 
$get_loadavg->(), which has the advantage that the gitweb admin can 
override it in gitweb config file (including such thing like simply 
using load average over last 5 minutes, and not over last minute)?

> The second changes the error message to use/abuse die_error() 
> vs. doing it's own thing (though I still think this should be on by
> default).  

True, the error message could use improvement (and not only using
its own class instead of abusing 'readme' class, or renaming 'readme'
class to something more generic).  The problem with error message for
this is who is the target of this message: is it gitweb administrator
(who can change gitweb configuration), or is it gitweb user (who need
to contact web admin).

The problem with this patch is that for it to be useful for protecting
against silent errors it should be on by default, but OTOH having it on
by default is quite inconvenient.

Best solution would be to treat core of this issue, namely eliminate
silent errors and always provide some message in case of error.

> Patch 4 I don't have anything to add or change at this point. 
>
> This patch has me pondering and I'm unsure of what I'd suggest, mainly
> because of the addition of the smart http support meaning that git://
> and http:// are legitimate and useful links for supporting full git
> transactions.
> 
> I may withdraw the patch entirely since the link on kernel.org has been
> around for years, and I'm unsure if anything actually uses it (though I
> can see it being useful still).  If it stays I think there's got to be a
> way to specifically mark a url as being the one to link to vs.
> defaulting to git:// (or allow for a marking to override the git://) and
> I need to ponder that.

Also, it has to be _fast_, I think, i.e. no reading cloneurl and repo 
config (for gitweb.url) for each repository.

You can always remove the check for "git://" prefix, and/or take first
base in @git_base_url_list.

> 
> I have given some initial thought to converting the $output options I'm
> currently using to a print <FH> that Jakub is suggesting & exploring.

It's 'print {$fh}', i.e. use indirect filehandle, not global filehandle.

> I think all told it's going to be a similarly sized patch, since all
> output still has to get adjusted (including the things that directly
> output but don't print).  

print -> print {$fh} can be separate patch, and it can be checked that
it produces the same results.  Well print -> $output .= could also be
separate patch...

> I'm unsure if there's a real advantage to 
> either way, other than design preference. My patch (forcing the output
> to get passed around) moves towards more of a modal style design
> separating data & layout vs. it's combined nature now, well it's a step
> in that direction anyway.

Errr... what?  Forcing buffering (you need to read whole output into
memory, including for snapshots (uncompressed in case of .tar.gz))
is IMVHO orthogonal to the issue of separating data & layout.
BTW. Modern web server interfaces like Rack, PSGI/Plack etc. explicitly
include streaming support.

The advantage of doing 'print {$fh}' is that $fh can be \*STDOUT, can
be \$buffer, but can be filehandle to (temporary) file on disk, and
you can even "tee" it, i.e. both write to memory/file, and to STDOUT.
The number of possible choices / possible improvements is much larger.

And what is also important it means that people who do not use caching
do not suffer latency penalty and memory pressure from caching 
infrastructure they do not use.


P.S. 
Subject: [Virus] Exploit.PDF-9669
X-Virus-Scanned: ClamAV 0.88.7/10275/Fri Jan  8 17:06:46 2010 on shards.monkeyblade.net
X-Virus-Status: Infected with Exploit.PDF-9669
X-Original-Subject: Re: [PATCHv3 3/4 (resent)] gitweb: Optionally add "git"
 links in project list page

A message sent from <warthog9@eaglescrag.net> to
        <jnareb@gmail.com>
        <git@vger.kernel.org>
        <warthog9@kernel.org>
contained Exploit.PDF-9669 and has not been delivered.

-- 
Jakub Narebski
Poland

^ permalink raw reply

* Re: Filename quoting / parsing problem
From: Andreas Schwab @ 2010-01-06 10:06 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Andreas Gruenbacher, git
In-Reply-To: <7viqbgniq1.fsf@alter.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> writes:

> So you can (and I think git-apply does) follow this simple rule:
>
>     If you see +++/---/rename from/rename to/new file/deleted file, use
>     the names you find there.  Otherwise, because there is no rename,
>     "diff --git" lines has two identical names that follow a/ and b/, so
>     use that name.

If you use diff.mnemonicprefix=true then a/ and b/ may be different.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply

* [RFC PATCH v2 0/2] Imporove remote helper exec failure reporting
From: Ilari Liusvaara @ 2010-01-09 13:45 UTC (permalink / raw)
  To: git

(This is newer than updated patch v3).

I decided to go on a bit further with new features, and that's why this
is back as RFC.

Diffrences from first RFC round:

- Split loop-over-close to its own function and warn but not retry on
  bizarre error codes (basically anything except EBADF and EINTR).
- Don't rely on pipe(2) to preserve the fd array on failure.
- Add some testcases.
- Fix buggy behaviour if report pipe read end winds up as fd #0.
- Set silent_exec_failure on executing remote helper.
- Make exec reporting in presence of preexec_cb controlled by flag to
  solve pager deadlock problems without preventing using preexec_cb
  with exec reporting entierely (the way pager is invoked is just
  fundamentially incompatible with exec reporting).
- Add flag to make run-command give different code for exec failing due to
  ENOENT than for other failures (including other ways to get ENOENT).
- change chdir failure to be reported as error (and pass error code back).
  BTW: Nothing seems to use that chdir feature, aside of new testcase.
- Report errors to parent's stderr.
- Don't retry waitpid on bizarre error codes (basically anything except
  EINTR).
- Make run_command actually complain about exec failing (as API docs
  say).

Ilari Liusvaara (2):
  Report exec errors from run-command
  Improve transport helper exec failure reporting

 Documentation/technical/api-run-command.txt |    2 +
 Makefile                                    |    1 +
 run-command.c                               |  196 +++++++++++++++++++++++++--
 run-command.h                               |    2 +
 t/t0061-run-command.sh                      |   20 +++
 test-run-command.c                          |   74 ++++++++++
 transport-helper.c                          |   27 +++-
 7 files changed, 305 insertions(+), 17 deletions(-)
 create mode 100755 t/t0061-run-command.sh
 create mode 100644 test-run-command.c

^ permalink raw reply

* [RFC PATCH v2 2/2] Improve transport helper exec failure reporting
From: Ilari Liusvaara @ 2010-01-09 13:45 UTC (permalink / raw)
  To: git
In-Reply-To: <1263044757-12560-1-git-send-email-ilari.liusvaara@elisanet.fi>

Previously transport-helper exec failure error reporting was pretty
much useless as it didn't report errors from execve, only from pipe
and fork. Now that run-command passes errno from exec, use the
improved support to actually print useful errors if execution fails.

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
---
 transport-helper.c |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/transport-helper.c b/transport-helper.c
index 5147296..72be965 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -102,6 +102,7 @@ static struct child_process *get_helper(struct transport *transport)
 	int refspec_nr = 0;
 	int refspec_alloc = 0;
 	int duped;
+	int code;
 
 	if (data->helper)
 		return data->helper;
@@ -111,13 +112,31 @@ static struct child_process *get_helper(struct transport *transport)
 	helper->out = -1;
 	helper->err = 0;
 	helper->argv = xcalloc(4, sizeof(*helper->argv));
-	strbuf_addf(&buf, "remote-%s", data->name);
+	strbuf_addf(&buf, "git-remote-%s", data->name);
 	helper->argv[0] = strbuf_detach(&buf, NULL);
 	helper->argv[1] = transport->remote->name;
 	helper->argv[2] = remove_ext_force(transport->url);
-	helper->git_cmd = 1;
-	if (start_command(helper))
-		die("Unable to run helper: git %s", helper->argv[0]);
+	helper->argv[2] = transport->url;
+	helper->git_cmd = 0;
+	helper->silent_exec_failure = 1;
+	helper->extended_error_code = 1;
+	/*
+	 * Print errors even if start_command should have printed them in
+	 * order to get proper fatal-level error message and include
+	 * errnos to make inevitable incomplete problem reports more useful
+	 * (those have nasty tendency of including only the last line that
+	 * looks like error).
+	 */
+	code = start_command(helper);
+	if (code == -2)
+		die("Unable to find remote helper for '%s'",
+			data->name);
+	else if(code == -1)
+		die_errno("Error running helper for '%s'", data->name);
+	else if(code != 0)
+		/* Shouldn't happen. */
+		die_errno("code %i running helper for '%s'", code, data->name);
+
 	data->helper = helper;
 	data->no_disconnect_req = 0;
 
-- 
1.6.6.3.gaa2e1

^ permalink raw reply related

* [RFC PATCH v2 1/2] Report exec errors from run-command
From: Ilari Liusvaara @ 2010-01-09 13:45 UTC (permalink / raw)
  To: git
In-Reply-To: <1263044757-12560-1-git-send-email-ilari.liusvaara@elisanet.fi>

Previously run-command was unable to report errors happening in exec
call. Change it to pass errno from failed exec to errno value at
return. Also add special mode that diffrentiates between ENOENT
from exec and ENOENT from other source.

The errno value passing can be done by opening close-on-exec pipe and
piping the error code through in case of failure. In case of success,
close-on-exec closes the pipe on successful exec and parent process
gets end of file on read.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
---
 Documentation/technical/api-run-command.txt |    2 +
 Makefile                                    |    1 +
 run-command.c                               |  196 +++++++++++++++++++++++++--
 run-command.h                               |    2 +
 t/t0061-run-command.sh                      |   20 +++
 test-run-command.c                          |   74 ++++++++++
 6 files changed, 282 insertions(+), 13 deletions(-)
 create mode 100755 t/t0061-run-command.sh
 create mode 100644 test-run-command.c

diff --git a/Documentation/technical/api-run-command.txt b/Documentation/technical/api-run-command.txt
index b26c281..f37d8ba 100644
--- a/Documentation/technical/api-run-command.txt
+++ b/Documentation/technical/api-run-command.txt
@@ -49,6 +49,8 @@ The functions above do the following:
 
 . If the program was not found, then -1 is returned and errno is set to
   ENOENT; a diagnostic is printed only if .silent_exec_failure is 0.
+  (if extended_error_code flag is true, instead of -1, the return value
+  is -2 in this case).
 
 . Otherwise, the program is run. If it terminates regularly, its exit
   code is returned. No diagnistic is printed, even if the exit code is
diff --git a/Makefile b/Makefile
index a2fce5a..92eed68 100644
--- a/Makefile
+++ b/Makefile
@@ -1753,6 +1753,7 @@ TEST_PROGRAMS_NEED_X += test-path-utils
 TEST_PROGRAMS_NEED_X += test-sha1
 TEST_PROGRAMS_NEED_X += test-sigchain
 TEST_PROGRAMS_NEED_X += test-index-version
+TEST_PROGRAMS_NEED_X += test-run-command
 
 TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
 
diff --git a/run-command.c b/run-command.c
index 47ced57..b1af9c4 100644
--- a/run-command.c
+++ b/run-command.c
@@ -15,6 +15,20 @@ static inline void dup_devnull(int to)
 	close(fd);
 }
 
+static inline void force_close(int fd)
+{
+	/*
+	 * Assume all errors except EINTR are persistent and
+	 * that EBADF signals already closed fd.
+	 */
+	while (close(fd) < 0 && errno != EBADF)
+		if (errno != EINTR) {
+			warning("Close returned error %s",
+				strerror(errno));
+			break;
+		}
+}
+
 static const char **prepare_shell_cmd(const char **argv)
 {
 	int argc, nargc = 0;
@@ -49,6 +63,8 @@ static const char **prepare_shell_cmd(const char **argv)
 }
 
 #ifndef WIN32
+int child_err = -1;
+
 static int execv_shell_cmd(const char **argv)
 {
 	const char **nargv = prepare_shell_cmd(argv);
@@ -57,6 +73,26 @@ static int execv_shell_cmd(const char **argv)
 	free(nargv);
 	return -1;
 }
+
+static void error_child(const char *err, ...)
+{
+	char msg[4096];
+	int len;
+	va_list args;
+	va_start(args, err);
+	len = vsnprintf(msg, sizeof(msg), err, args);
+	va_end(args);
+	if (len >= sizeof(msg))
+		len = sizeof(msg) - 1;
+
+	if (child_err < 0)
+		return;
+
+	write(child_err, "error: ", 7);
+	write(child_err, msg, len);
+	write(child_err, "\n", 1);
+}
+
 #endif
 
 int start_command(struct child_process *cmd)
@@ -64,6 +100,7 @@ int start_command(struct child_process *cmd)
 	int need_in, need_out, need_err;
 	int fdin[2], fdout[2], fderr[2];
 	int failed_errno = failed_errno;
+	int func_ret = 0;
 
 	/*
 	 * In case of errors we must keep the promise to close FDs
@@ -120,9 +157,91 @@ fail_pipe:
 	trace_argv_printf(cmd->argv, "trace: run_command:");
 
 #ifndef WIN32
+{
+	int report_pipe[2] = {-1, -1};
+
+	if (pipe(report_pipe) < 0) {
+		report_pipe[0] = -1;
+		report_pipe[1] = -1;
+		warning("Can't open pipe for exec status report: %s\n",
+			strerror(errno));
+	}
+
 	fflush(NULL);
 	cmd->pid = fork();
-	if (!cmd->pid) {
+	if (cmd->pid > 0) {
+		int r = 0, ret = 0;
+		force_close(report_pipe[1]);
+read_again:
+		if (report_pipe[0] >= 0)
+			r = read(report_pipe[0], &ret, sizeof(ret));
+		if (r < 0 && (errno == EAGAIN || errno == EINTR ||
+			errno == EWOULDBLOCK))
+			goto read_again;
+		else if (r < 0)
+			warning("Can't read exec status report: %s\n",
+				strerror(errno));
+		else if (r == 0)
+			;
+		else if (r < sizeof(ret)) {
+			warning("Received incomplete exec status report.\n");
+		} else {
+			failed_errno = ret;
+			/*
+			 * Clean up the process that did the failed execution
+			 * so no zombies remain.
+			 */
+			while (waitpid(cmd->pid, &ret, 0) < 0 && errno == EINTR)
+				/* Nothing. */ ;
+			if (WIFEXITED(ret) && WEXITSTATUS(ret) == 127)
+				/* Program was not found. */
+				func_ret = -2;
+			cmd->pid = -1;
+		}
+	} else if (!cmd->pid) {
+		int r = 0;
+		int errored = 0;
+		int flags;
+		force_close(report_pipe[0]);
+
+		flags = fcntl(report_pipe[1], F_GETFD);
+		if (flags < 0)
+			r = -1;
+		r = (r || fcntl(report_pipe[1], F_SETFD, flags | FD_CLOEXEC));
+		if (r) {
+			warning("Can't FD_CLOEXEC pipe for exec status report: %s",
+				strerror(errno));
+			force_close(report_pipe[1]);
+			report_pipe[1] = -1;
+		}
+
+		/*
+		 * Redirect the channel to write syscall error messages to
+		 * before redirecting the process's stderr so that all error
+		 * messages in subsequent call paths use the parent's stderr.
+		 */
+		if (cmd->no_stderr || need_err) {
+			child_err = dup(2);
+			if (child_err < 0 && errno != EBADF)
+				/* EBADF => No stderr, nowhere to go. */
+				warning("Can't dup fd for child exec errors: %s",
+					strerror(errno));
+			if (child_err < 0)
+				goto no_error_chan;
+
+			flags = fcntl(child_err, F_GETFL);
+			if (flags < 0)
+				flags = 0;
+			if (fcntl(child_err, F_SETFL, flags | FD_CLOEXEC) < 0) {
+				warning("Can't FD_CLOEXEC fd for child exec errors: %s",
+					strerror(errno));
+				force_close(report_pipe[1]);
+				child_err = -1;
+			}
+		} else
+			child_err = 2;
+no_error_chan:
+
 		if (cmd->no_stdin)
 			dup_devnull(0);
 		else if (need_in) {
@@ -152,9 +271,15 @@ fail_pipe:
 			close(cmd->out);
 		}
 
-		if (cmd->dir && chdir(cmd->dir))
-			die_errno("exec '%s': cd to '%s' failed", cmd->argv[0],
-			    cmd->dir);
+		if (cmd->dir && chdir(cmd->dir)) {
+			failed_errno = errno;
+			error_child("exec '%s': cd to '%s' failed: %s",
+				cmd->argv[0], cmd->dir, strerror(errno));
+			trace_printf("trace: exec '%s': cd to '%s' failed: %s\n",
+				cmd->argv[0], cmd->dir, strerror(errno));
+			errored = 1;
+			goto throw_fault;
+		}
 		if (cmd->env) {
 			for (; *cmd->env; cmd->env++) {
 				if (strchr(*cmd->env, '='))
@@ -163,8 +288,23 @@ fail_pipe:
 					unsetenv(*cmd->env);
 			}
 		}
-		if (cmd->preexec_cb)
+		if (cmd->preexec_cb) {
+			/*
+			 * We don't know what pre-exec callbacks do, and they
+			 * may do something that causes deadlock with exec
+			 * reporting. The sole user of this hook seems to
+			 * be pager, and it is run through shell, so one
+			 * wouldn't get useful error from exec reporting
+			 * and would get useful error from shell anyway. So
+			 * just disable exec reporting for such comamnds.
+			 * (unless explicitly specified otherwise).
+			 */
+			if (!cmd->report_preexec_cb) {
+				force_close(report_pipe[1]);
+				report_pipe[1] = -1;
+			}
 			cmd->preexec_cb();
+		}
 		if (cmd->git_cmd) {
 			execv_git_cmd(cmd->argv);
 		} else if (cmd->use_shell) {
@@ -172,13 +312,36 @@ fail_pipe:
 		} else {
 			execvp(cmd->argv[0], (char *const*) cmd->argv);
 		}
+		failed_errno = errno;
+
 		trace_printf("trace: exec '%s' failed: %s\n", cmd->argv[0],
 				strerror(errno));
-		exit(127);
-	}
-	if (cmd->pid < 0)
+
+		if (!cmd->silent_exec_failure || errno != ENOENT)
+			error_child("cannot exec '%s': %s",
+				cmd->argv[0], strerror(failed_errno));
+throw_fault:
+		r = 0;
+write_again:
+		if (report_pipe[1] >= 0)
+			r = write(report_pipe[1], &failed_errno,
+				sizeof(failed_errno));
+		if (r < 0 && (errno == EAGAIN || errno == EINTR ||
+			errno == EWOULDBLOCK))
+			goto write_again;
+
+		/*
+		 * Diffrentiate between program doesn't exist and other
+		 * errors.
+		 */
+		if (errored || errno != ENOENT)
+			exit(128);
+		else
+			exit(127);
+	} else if (cmd->pid < 0)
 		error("cannot fork() for %s: %s", cmd->argv[0],
 			strerror(failed_errno = errno));
+}
 #else
 {
 	int s0 = -1, s1 = -1, s2 = -1;	/* backups of stdin, stdout, stderr */
@@ -233,6 +396,8 @@ fail_pipe:
 	failed_errno = errno;
 	if (cmd->pid < 0 && (!cmd->silent_exec_failure || errno != ENOENT))
 		error("cannot spawn %s: %s", cmd->argv[0], strerror(errno));
+	if (cmd->pid < 0 && errno == ENOENT)
+		func_ret = -2;
 
 	if (cmd->env)
 		free_environ(env);
@@ -261,7 +426,10 @@ fail_pipe:
 		if (need_err)
 			close_pair(fderr);
 		errno = failed_errno;
-		return -1;
+		if (cmd->extended_error_code && func_ret)
+			return func_ret;
+		else
+			return -1;
 	}
 
 	if (need_in)
@@ -280,7 +448,8 @@ fail_pipe:
 	return 0;
 }
 
-static int wait_or_whine(pid_t pid, const char *argv0, int silent_exec_failure)
+static int wait_or_whine(pid_t pid, const char *argv0, int silent_exec_failure,
+	int extended_err)
 {
 	int status, code = -1;
 	pid_t waiting;
@@ -309,7 +478,7 @@ static int wait_or_whine(pid_t pid, const char *argv0, int silent_exec_failure)
 		 * Convert special exit code when execvp failed.
 		 */
 		if (code == 127) {
-			code = -1;
+			code = extended_err ? -2 : -1;
 			failed_errno = ENOENT;
 			if (!silent_exec_failure)
 				error("cannot run %s: %s", argv0,
@@ -324,7 +493,8 @@ static int wait_or_whine(pid_t pid, const char *argv0, int silent_exec_failure)
 
 int finish_command(struct child_process *cmd)
 {
-	return wait_or_whine(cmd->pid, cmd->argv[0], cmd->silent_exec_failure);
+	return wait_or_whine(cmd->pid, cmd->argv[0], cmd->silent_exec_failure,
+		cmd->extended_error_code);
 }
 
 int run_command(struct child_process *cmd)
@@ -410,7 +580,7 @@ int start_async(struct async *async)
 int finish_async(struct async *async)
 {
 #ifndef WIN32
-	int ret = wait_or_whine(async->pid, "child process", 0);
+	int ret = wait_or_whine(async->pid, "child process", 0, 0);
 #else
 	DWORD ret = 0;
 	if (WaitForSingleObject(async->tid, INFINITE) != WAIT_OBJECT_0)
diff --git a/run-command.h b/run-command.h
index 967ba8c..f6b4caf 100644
--- a/run-command.h
+++ b/run-command.h
@@ -34,6 +34,8 @@ struct child_process {
 	unsigned silent_exec_failure:1;
 	unsigned stdout_to_stderr:1;
 	unsigned use_shell:1;
+	unsigned extended_error_code:1;
+	unsigned report_preexec_cb:1;
 	void (*preexec_cb)(void);
 };
 
diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh
new file mode 100755
index 0000000..0c217b1
--- /dev/null
+++ b/t/t0061-run-command.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Copyright (c) 2009 Ilari Liusvaara
+#
+
+test_description='Test run command'
+
+. ./test-lib.sh
+
+test_expect_success "reporting ENOENT (non-extended)" \
+"test-run-command 2"
+
+test_expect_success "reporting ENOENT (extended)" \
+"test-run-command 1"
+
+test_expect_success "reporting chdir failed (extended)" \
+"test-run-command 3"
+
+
+test_done
diff --git a/test-run-command.c b/test-run-command.c
new file mode 100644
index 0000000..db664f3
--- /dev/null
+++ b/test-run-command.c
@@ -0,0 +1,74 @@
+/*
+ * test-run-command.c: test run command API.
+ *
+ * (C) 2009 Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
+ *
+ * This code is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "git-compat-util.h"
+#include "run-command.h"
+#include <string.h>
+#include <errno.h>
+
+int main(int argc, char **argv)
+{
+	char* procs[2];
+	struct child_process proc;
+	char test = argv[1][0];
+	memset(&proc, 0, sizeof(proc));
+
+	if(argc < 2)
+		return 1;
+
+
+	switch(test) {
+	case '1':
+		procs[0] = "does-not-exist-62896869286";
+		procs[1] = NULL;
+		proc.argv = (const char **)procs;
+		proc.extended_error_code = 1;
+
+		if (start_command(&proc) != -2) {
+			fprintf(stderr, "FAIL A\n");
+			return 1;
+		}
+		if (test == '1' && errno == ENOENT)
+			return 0;
+	case '2':
+		procs[0] = "does-not-exist-62896869286";
+		procs[1] = NULL;
+		proc.argv = (const char **)procs;
+		proc.extended_error_code = 0;
+
+		if (start_command(&proc) != -1) {
+			fprintf(stderr, "FAIL A\n");
+			return 1;
+		}
+		if (errno == ENOENT)
+			return 0;
+	case '3':
+#ifdef WIN32
+		/* This can't work on Win32, so just skip it. */
+		return 0;
+#endif
+		procs[0] = "does-not-exist-62896869286";
+		procs[1] = NULL;
+		proc.argv = (const char **)procs;
+		proc.dir = "does-not-exist-52632632733";
+		proc.extended_error_code = 1;
+
+		if (start_command(&proc) != -1) {
+			fprintf(stderr, "FAIL A\n");
+			return 1;
+		}
+		if (errno == ENOENT)
+			return 0;
+	}
+
+	fprintf(stderr, "FAIL B\n");
+
+	return 1;
+}
-- 
1.6.6.3.gaa2e1

^ permalink raw reply related

* [PATCH] daemon: consider only address in kill_some_child()
From: Erik Faye-Lund @ 2010-01-09 14:13 UTC (permalink / raw)
  To: git; +Cc: Erik Faye-Lund

kill_some_child() compares the entire sockaddr_storage
structure (with the pad-bits zeroed out) when trying to
find out if connections originate from the same host.
However, sockaddr_storage contains the port-number for
the connection (which varies between connections), so
the comparison always fails.

Change the code so we only consider the host-address,
by introducing the addrcmp()-function that inspects
the address family and compare as appropriate.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
---
 daemon.c |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/daemon.c b/daemon.c
index 5783e24..918e560 100644
--- a/daemon.c
+++ b/daemon.c
@@ -562,6 +562,24 @@ static int execute(struct sockaddr *addr)
 	return -1;
 }
 
+static int addrcmp(const struct sockaddr_storage *s1,
+    const struct sockaddr_storage *s2)
+{
+	if (s1->ss_family != s2->ss_family)
+		return s1->ss_family - s2->ss_family;
+	if (s1->ss_family == AF_INET)
+		return memcmp(&((struct sockaddr_in *)s1)->sin_addr,
+		    &((struct sockaddr_in *)s2)->sin_addr,
+		    sizeof(struct in_addr));
+#ifndef NO_IPV6
+	if (s1->ss_family == AF_INET6)
+		return memcmp(&((struct sockaddr_in6 *)s1)->sin6_addr,
+		    &((struct sockaddr_in6 *)s2)->sin6_addr,
+		    sizeof(struct in6_addr));
+#endif
+	return 0;
+}
+
 static int max_connections = 32;
 
 static unsigned int live_children;
@@ -576,17 +594,12 @@ static void add_child(pid_t pid, struct sockaddr *addr, int addrlen)
 {
 	struct child *newborn, **cradle;
 
-	/*
-	 * This must be xcalloc() -- we'll compare the whole sockaddr_storage
-	 * but individual address may be shorter.
-	 */
 	newborn = xcalloc(1, sizeof(*newborn));
 	live_children++;
 	newborn->pid = pid;
 	memcpy(&newborn->address, addr, addrlen);
 	for (cradle = &firstborn; *cradle; cradle = &(*cradle)->next)
-		if (!memcmp(&(*cradle)->address, &newborn->address,
-			    sizeof(newborn->address)))
+		if (!addrcmp(&(*cradle)->address, &newborn->address))
 			break;
 	newborn->next = *cradle;
 	*cradle = newborn;
@@ -619,8 +632,7 @@ static void kill_some_child(void)
 		return;
 
 	for (; (next = blanket->next); blanket = next)
-		if (!memcmp(&blanket->address, &next->address,
-			    sizeof(next->address))) {
+		if (!addrcmp(&blanket->address, &next->address)) {
 			kill(blanket->pid, SIGTERM);
 			break;
 		}
-- 
1.6.6.95.gae285

^ permalink raw reply related

* Re: [PATCH] daemon: consider only address in kill_some_child()
From: Junio C Hamano @ 2010-01-09 17:20 UTC (permalink / raw)
  To: Erik Faye-Lund; +Cc: git, Erik Faye-Lund
In-Reply-To: <1263046408-2368-1-git-send-email-kusmabite@gmail.com>

Erik Faye-Lund <kusmabite@googlemail.com> writes:

> kill_some_child() compares the entire sockaddr_storage structure (with
> the pad-bits zeroed out) when trying to find out if connections
> originate from the same host.  However, sockaddr_storage contains the
> port-number for the connection (which varies between connections), so
> the comparison always fails.
>
> Change the code so we only consider the host-address, by introducing the
> addrcmp()-function that inspects the address family and compare as
> appropriate.
>
> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
> ---

Makes sense.

^ permalink raw reply

* Re: [PATCH v2 0/2] Support relative .git file in a submodule
From: Junio C Hamano @ 2010-01-09 17:20 UTC (permalink / raw)
  To: Brad King; +Cc: git, Avery Pennarun, Lars Hjemli
In-Reply-To: <1263008201-27429-1-git-send-email-brad.king@kitware.com>

Brad King <brad.king@kitware.com> writes:

> Exactly.  In fact the experiment I was doing involved creating submodule
> repos inside the main .git and linking to them from the work tree
> subdirectories.  I'm looking into combining the approach with that of
> git-new-workdir to keep submodules in the same object database.

Nice.

I recall we discussed design ideas to allow moving the submodule worktree
and repository more easily using "gitdir:" when we first discussed the
patch series.  I am glad to see finally it is going forward.

^ permalink raw reply

* [BUGFIX] Reset possible helper before reusing remote structure
From: Ilari Liusvaara @ 2010-01-09 17:28 UTC (permalink / raw)
  To: git

If one had multiple URLs configured for remote with previous one
having forced helper but the subsequent one not, like:

url = foo::bar://baz
url = ssh://example/example.git

Then the subsequent URL is passed to foo helper, which isn't
correct. Fix it to be parsed normally by resetting foreign VCS
name before parsing the URL protocol.

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
---
 transport.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/transport.c b/transport.c
index 97bb5e6..669bc85 100644
--- a/transport.c
+++ b/transport.c
@@ -875,6 +875,9 @@ struct transport *transport_get(struct remote *remote, const char *url)
 		url = remote->url[0];
 	ret->url = url;
 
+	/* In case previous URL had helper forced, reset it. */
+	remote->foreign_vcs = NULL;
+
 	/* maybe it is a foreign URL? */
 	if (url) {
 		const char *p = url;
-- 
1.6.6.3.gaa2e1

^ permalink raw reply related

* Re: [PATCH] ls-files: fix overeager pathspec optimization
From: Linus Torvalds @ 2010-01-09 18:05 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, Michael J Gruber, Jon Schewe, spearce, git
In-Reply-To: <7vfx6f3dm3.fsf@alter.siamese.dyndns.org>



On Sat, 9 Jan 2010, Junio C Hamano wrote:
> 
> Having sent these patches, I am wondering if the simplest fix might be this
> one-liner.
> 
> diff --git a/dir.c b/dir.c
> index d0999ba..7fba335 100644
> --- a/dir.c
> +++ b/dir.c
> @@ -788,3 +788,3 @@ int read_directory(struct dir_struct *dir, const char *path, int len, const char
>  	simplify = create_simplify(pathspec);
> -	read_directory_recursive(dir, path, len, 0, simplify);
> +	read_directory_recursive(dir, "", 0, 0, simplify);
>  	free_simplify(simplify);

That one-liner doesn't work at all for me.

Lookie here:

	[torvalds@nehalem linux]$ touch drivers/char/hello.c
	[torvalds@nehalem linux]$ ~/git/git ls-files --exclude-standard -o drivers/char
	[torvalds@nehalem linux]$ git ls-files --exclude-standard -o drivers/char
	drivers/char/hello.c

where that ~/git/git is the version with the one-liner.

IOW, it now ignores _everything_, because the dir and the path don't 
match.

		Linus

^ permalink raw reply

* Re: For real now: bug tracking and secretary tasks in git
From: Thiago Farina @ 2010-01-09 20:22 UTC (permalink / raw)
  To: Jan Krüger; +Cc: Git ML
In-Reply-To: <20100109013850.16f82412@perceptron>

On Fri, Jan 8, 2010 at 10:38 PM, Jan Krüger <jk@jk.gs> wrote:
> The proposal goes like this:
>
> * Set up bug tracker (done; it's at http://gitbugs.jk.gs/).
Thanks for doing that!!

^ permalink raw reply

* Re: [PATCH (v2) 2/2] rebase -i: teach --onto A...B syntax
From: Avery Pennarun @ 2010-01-09 21:02 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: A Large Angry SCM, Sverre Rabbelier, Junio C Hamano,
	Nanako Shiraishi, git
In-Reply-To: <alpine.DEB.1.00.1001090235520.4985@pacific.mpi-cbg.de>

On Fri, Jan 8, 2010 at 8:36 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> On Fri, 8 Jan 2010, A Large Angry SCM wrote:
>> Sverre Rabbelier wrote:
>> > *cough* git sequencer *cough*
>>
>> *cough* not in my ${PATH} *cough*
>
> *cough* because that GSoC project failed in all but writing? *cough*

Is there a summary of the results somewhere?  I can find a lot of
discussions of git-sequencer, but not what went right/wrong or if it
turned out to be a good/bad idea.

Avery

^ permalink raw reply

* [PATCH resend] gitk: Adjust two equal strings which differed in whitespace
From: Markus Heidelberg @ 2010-01-09 22:11 UTC (permalink / raw)
  To: Paul Mackerras, Christian Stimming; +Cc: git, Markus Heidelberg

There were the two strings "SHA1 ID: " and "SHA1 ID:" as description for
the SHA1 search textbox. Change it to two equal strings, the space is
now outside of the translated string.

Furthermore the German translation wasn't unique, but "SHA1:" resp.
"SHA1-Hashwert:". The former was displayed after initialisation, the
latter after changes to the textbox, for example when clearing the text.
But it was too long to be displayed fully, so use a shorter translation.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
 gitk     |    2 +-
 po/de.po |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gitk b/gitk
index 86dff0f..d8364c4 100755
--- a/gitk
+++ b/gitk
@@ -2088,7 +2088,7 @@ proc makewindow {} {
     set sha1entry .tf.bar.sha1
     set entries $sha1entry
     set sha1but .tf.bar.sha1label
-    button $sha1but -text [mc "SHA1 ID: "] -state disabled -relief flat \
+    button $sha1but -text "[mc "SHA1 ID:"] " -state disabled -relief flat \
 	-command gotocommit -width 8
     $sha1but conf -disabledforeground [$sha1but cget -foreground]
     pack .tf.bar.sha1label -side left
diff --git a/po/de.po b/po/de.po
index 53ef0d6..e224595 100644
--- a/po/de.po
+++ b/po/de.po
@@ -708,7 +708,7 @@ msgstr "Gehe zu:"
 
 #: gitk:7821
 msgid "SHA1 ID:"
-msgstr "SHA1-Hashwert:"
+msgstr "SHA1 ID:"
 
 #: gitk:7840
 #, tcl-format
-- 
1.6.6.109.g052a6a

^ permalink raw reply related

* [PATCH v2 0/4] Documentation style fixes
From: Thomas Rast @ 2010-01-10  0:02 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jonathan Nieder
In-Reply-To: <7vaawp4wvz.fsf@alter.siamese.dyndns.org>

I'm violating the midnight rule, so there's probably something wrong
with this series.

Junio C Hamano wrote:
> I am tempted to suggest describing the command in terms of more common use
> pattern, describing the flexible and more general form as "an aside" for
> more advanced users, perhaps like this.
> 
>         <branch>...:
>                 Other branch to merge into the current branch...trying an
>                 Octopus merge.
>         +
>         Strictly speaking, these can name arbitrary commits, not necessarily
>         at the tip of branches.  e.g. "git merge topic{tilde}4" lets you merge
>         the topic except for the last 4 commits.
> 
> I don't know if such an arrangement really makes the document more
> approachable to new people, or it is making the description longer and
> more complicated without helping new people, though (that is why this is
> just "I am tempted to").

Not sure.  I have a bit of an aversion against "lying" in the
synopsis, even though the common use-case really is a branch.

> Thomas Rast <trast@student.ethz.ch> writes:
> > * More importantly, while `code` style seems to be an improvement in
> >   HTML output (because it gives typewriter font), my local 'man'
> >   renders 'emphasis' as underlines -- which actually makes the code
> >   snippets much more visible than `literal` quotes which are not
> >   rendered specially at all.
> >
> > So which way should it be changed?
> 
> I'd prefer to see us mark code as `code`.

I tried to make it so, including a few other places that grep found.

Regarding 'git-cmd' vs. 'git cmd', I found that we're in the somewhat
unsatisfactory situation where the git-svn manpage uses dashless since
647ac70 (git-svn.txt: stop using dash-form of commands., 2009-07-07).
Most of the rest uses dashed, but there sometimes even were
inconsistent uses very close to each other.  Dashless seems to be a
bit more common in newer patches, and does have the advantage that it
does not need an exception for 'git submodule update' and friends.

So I tried to sed it towards the dashless form, with a few exceptions.
The churn, of course, is rather daunting.  The other alternative,
returning to dashed forms, would mean reverting 647ac70 and then more
applications of sed to fix the stray dashless uses, being careful to
preserve the SYNOPSIS sections.


Thomas Rast (4):
  Documentation/git-merge: reword references to "remote" and "pull"
  Documentation: warn prominently against merging with dirty trees
  Documentation: format full commands in typewriter font
  Documentation: spell 'git cmd' without dash throughout

 Documentation/config.txt                |   70 +++++++-------
 Documentation/fetch-options.txt         |   10 +-
 Documentation/git-add.txt               |    2 +-
 Documentation/git-am.txt                |   10 +-
 Documentation/git-apply.txt             |   10 +-
 Documentation/git-archimport.txt        |   12 ++--
 Documentation/git-archive.txt           |    2 +-
 Documentation/git-bisect.txt            |    2 +-
 Documentation/git-blame.txt             |    8 +-
 Documentation/git-branch.txt            |    6 +-
 Documentation/git-bundle.txt            |   26 +++---
 Documentation/git-check-ref-format.txt  |    2 +-
 Documentation/git-checkout-index.txt    |    8 +-
 Documentation/git-cherry-pick.txt       |    2 +-
 Documentation/git-cherry.txt            |    6 +-
 Documentation/git-citool.txt            |    4 +-
 Documentation/git-clean.txt             |    4 +-
 Documentation/git-commit-tree.txt       |    2 +-
 Documentation/git-commit.txt            |   18 ++--
 Documentation/git-config.txt            |   14 ++--
 Documentation/git-cvsexportcommit.txt   |    2 +-
 Documentation/git-cvsimport.txt         |   18 ++--
 Documentation/git-cvsserver.txt         |    6 +-
 Documentation/git-daemon.txt            |   40 ++++----
 Documentation/git-describe.txt          |    6 +-
 Documentation/git-diff-files.txt        |    2 +-
 Documentation/git-diff-index.txt        |   16 ++--
 Documentation/git-diff-tree.txt         |    4 +-
 Documentation/git-difftool.txt          |   16 ++--
 Documentation/git-fast-export.txt       |   12 ++--
 Documentation/git-fast-import.txt       |   20 ++--
 Documentation/git-fetch-pack.txt        |    6 +-
 Documentation/git-fetch.txt             |    2 +-
 Documentation/git-filter-branch.txt     |   24 +++---
 Documentation/git-fmt-merge-msg.txt     |    2 +-
 Documentation/git-format-patch.txt      |    4 +-
 Documentation/git-fsck.txt              |    4 +-
 Documentation/git-gc.txt                |   18 ++--
 Documentation/git-get-tar-commit-id.txt |    4 +-
 Documentation/git-grep.txt              |    2 +-
 Documentation/git-gui.txt               |   20 ++--
 Documentation/git-hash-object.txt       |    2 +-
 Documentation/git-help.txt              |    6 +-
 Documentation/git-http-backend.txt      |   22 +++---
 Documentation/git-http-fetch.txt        |    2 +-
 Documentation/git-imap-send.txt         |    2 +-
 Documentation/git-index-pack.txt        |    8 +-
 Documentation/git-init.txt              |    6 +-
 Documentation/git-log.txt               |    2 +-
 Documentation/git-ls-files.txt          |    4 +-
 Documentation/git-ls-tree.txt           |    4 +-
 Documentation/git-mailinfo.txt          |    2 +-
 Documentation/git-merge-file.txt        |   10 +-
 Documentation/git-merge-index.txt       |    6 +-
 Documentation/git-merge-one-file.txt    |    2 +-
 Documentation/git-merge.txt             |   54 ++++++-----
 Documentation/git-mergetool.txt         |   16 ++--
 Documentation/git-name-rev.txt          |    4 +-
 Documentation/git-notes.txt             |    2 +-
 Documentation/git-pack-objects.txt      |    6 +-
 Documentation/git-pack-redundant.txt    |    2 +-
 Documentation/git-patch-id.txt          |    2 +-
 Documentation/git-peek-remote.txt       |    2 +-
 Documentation/git-prune.txt             |   14 ++--
 Documentation/git-pull.txt              |   14 ++-
 Documentation/git-push.txt              |    6 +-
 Documentation/git-read-tree.txt         |   40 ++++----
 Documentation/git-rebase.txt            |   38 ++++----
 Documentation/git-receive-pack.txt      |    6 +-
 Documentation/git-reflog.txt            |    2 +-
 Documentation/git-remote.txt            |    2 +-
 Documentation/git-repack.txt            |   10 +-
 Documentation/git-replace.txt           |    2 +-
 Documentation/git-rerere.txt            |   26 +++---
 Documentation/git-reset.txt             |    2 +-
 Documentation/git-rev-list.txt          |    6 +-
 Documentation/git-rev-parse.txt         |   30 +++---
 Documentation/git-revert.txt            |    8 +-
 Documentation/git-send-pack.txt         |    4 +-
 Documentation/git-sh-setup.txt          |    2 +-
 Documentation/git-shortlog.txt          |    4 +-
 Documentation/git-show-index.txt        |    2 +-
 Documentation/git-show-ref.txt          |    4 +-
 Documentation/git-show.txt              |    4 +-
 Documentation/git-stash.txt             |    8 +-
 Documentation/git-status.txt            |    2 +-
 Documentation/git-submodule.txt         |    8 +-
 Documentation/git-symbolic-ref.txt      |    2 +-
 Documentation/git-tag.txt               |    6 +-
 Documentation/git-tar-tree.txt          |    4 +-
 Documentation/git-update-index.txt      |   14 ++--
 Documentation/git-upload-archive.txt    |    2 +-
 Documentation/git-upload-pack.txt       |    8 +-
 Documentation/git-var.txt               |    2 +-
 Documentation/git-verify-pack.txt       |    2 +-
 Documentation/git-verify-tag.txt        |    2 +-
 Documentation/git-web--browse.txt       |    2 +-
 Documentation/git-whatchanged.txt       |    4 +-
 Documentation/git-write-tree.txt        |    8 +-
 Documentation/git.txt                   |    8 +-
 Documentation/gitattributes.txt         |   12 ++--
 Documentation/gitcore-tutorial.txt      |  148 +++++++++++++++---------------
 Documentation/gitcvs-migration.txt      |   10 +-
 Documentation/gitdiffcore.txt           |    8 +-
 Documentation/githooks.txt              |   56 ++++++------
 Documentation/gitignore.txt             |    4 +-
 Documentation/gitk.txt                  |    2 +-
 Documentation/gitrepository-layout.txt  |   16 ++--
 Documentation/gittutorial-2.txt         |   16 ++--
 Documentation/gittutorial.txt           |   42 +++++-----
 Documentation/gitworkflows.txt          |    6 +-
 Documentation/i18n.txt                  |    4 +-
 Documentation/merge-options.txt         |    4 +-
 Documentation/pull-fetch-param.txt      |    8 +-
 Documentation/urls-remotes.txt          |    4 +-
 115 files changed, 634 insertions(+), 626 deletions(-)

^ permalink raw reply

* [PATCH v2 1/4] Documentation/git-merge: reword references to "remote" and "pull"
From: Thomas Rast @ 2010-01-10  0:02 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jonathan Nieder
In-Reply-To: <cover.1263081032.git.trast@student.ethz.ch>

The git-merge manpage was written in terms of merging a "remote",
which is no longer the case: you merge local or remote-tracking
branches; pull is for actual remotes.

Adjust the manpage accordingly.  We refer to the arguments as
"commits", and change instances of "remote" to "other" (where branches
are concerned) or "theirs" (where conflict sides are concerned).
Remove the single reference to "pulling".

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 Documentation/git-merge.txt |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index e886c2e..4896587 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -10,17 +10,17 @@ SYNOPSIS
 --------
 [verse]
 'git merge' [-n] [--stat] [--no-commit] [--squash] [-s <strategy>]...
-	[-m <msg>] <remote>...
-'git merge' <msg> HEAD <remote>...
+	[-m <msg>] <commit>...
+'git merge' <msg> HEAD <commit>...
 
 DESCRIPTION
 -----------
-This is the top-level interface to the merge machinery
-which drives multiple merge strategy scripts.
+Merges the history specified by <commit> into HEAD, optionally using a
+specific merge strategy.
 
-The second syntax (<msg> `HEAD` <remote>) is supported for
+The second syntax (<msg> `HEAD` <commit>...) is supported for
 historical reasons.  Do not use it from the command line or in
-new scripts.  It is the same as `git merge -m <msg> <remote>`.
+new scripts.  It is the same as `git merge -m <msg> <commit>...`.
 
 
 OPTIONS
@@ -33,10 +33,10 @@ include::merge-options.txt[]
 	used to give a good default for automated 'git merge'
 	invocations.
 
-<remote>...::
-	Other branch heads to merge into our branch.  You need at
-	least one <remote>.  Specifying more than one <remote>
-	obviously means you are trying an Octopus.
+<commit>...::
+	Commits, usually other branch heads, to merge into our branch.
+	You need at least one <commit>.  Specifying more than one
+	<commit> obviously means you are trying an Octopus.
 
 include::merge-strategies.txt[]
 
@@ -96,8 +96,8 @@ file matches exactly the current `HEAD` commit; otherwise we
 will write out your local changes already registered in your
 index file along with the merge result, which is not good.
 Because 1. involves only those paths differing between your
-branch and the remote branch you are pulling from during the
-merge (which is typically a fraction of the whole tree), you can
+branch and the branch you are merging
+(which is typically a fraction of the whole tree), you can
 have local modifications in your working tree as long as they do
 not overlap with what the merge updates.
 
@@ -110,7 +110,7 @@ When there are conflicts, the following happens:
 
 3. For conflicting paths, the index file records up to three
    versions; stage1 stores the version from the common ancestor,
-   stage2 from `HEAD`, and stage3 from the remote branch (you
+   stage2 from `HEAD`, and stage3 from the other branch (you
    can inspect the stages with `git ls-files -u`).  The working
    tree files contain the result of the "merge" program; i.e. 3-way
    merge results with familiar conflict markers `<<< === >>>`.
@@ -202,15 +202,15 @@ You can work through the conflict with a number of tools:
    mergetool which will work you through the merge.
 
  * Look at the diffs.  'git diff' will show a three-way diff,
-   highlighting changes from both the HEAD and remote versions.
+   highlighting changes from both the HEAD and their versions.
 
  * Look at the diffs on their own. 'git log --merge -p <path>'
-   will show diffs first for the HEAD version and then the
-   remote version.
+   will show diffs first for the HEAD version and then
+   their version.
 
  * Look at the originals.  'git show :1:filename' shows the
    common ancestor, 'git show :2:filename' shows the HEAD
-   version and 'git show :3:filename' shows the remote version.
+   version and 'git show :3:filename' shows their version.
 
 
 EXAMPLES
-- 
1.6.6.218.g502b0

^ permalink raw reply related

* [PATCH v2 2/4] Documentation: warn prominently against merging with dirty trees
From: Thomas Rast @ 2010-01-10  0:02 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jonathan Nieder
In-Reply-To: <cover.1263081032.git.trast@student.ethz.ch>

We do this for both git-merge and git-pull, so as to hopefully alert
(over)users of git-pull to the issue.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 Documentation/git-merge.txt |    4 ++++
 Documentation/git-pull.txt  |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 4896587..3277f4e 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -22,6 +22,10 @@ The second syntax (<msg> `HEAD` <commit>...) is supported for
 historical reasons.  Do not use it from the command line or in
 new scripts.  It is the same as `git merge -m <msg> <commit>...`.
 
+*Warning*: Running 'git-merge' with uncommitted changes is
+discouraged: while possible, it leaves you in a state that is hard to
+back out of in the case of a conflict.
+
 
 OPTIONS
 -------
diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index b932011..b3fa312 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -24,6 +24,10 @@ when merging local branches into the current branch.
 Also note that options meant for 'git-pull' itself and underlying
 'git-merge' must be given before the options meant for 'git-fetch'.
 
+*Warning*: Running 'git-pull' (actually, the underlying 'git-merge')
+with uncommitted changes is discouraged: while possible, it leaves you
+in a state that is hard to back out of in the case of a conflict.
+
 OPTIONS
 -------
 
-- 
1.6.6.218.g502b0

^ permalink raw reply related

* [PATCH v2 3/4] Documentation: format full commands in typewriter font
From: Thomas Rast @ 2010-01-10  0:02 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jonathan Nieder
In-Reply-To: <cover.1263081032.git.trast@student.ethz.ch>

Use `code snippet` style instead of 'emphasis' for `git cmd ...`
according to the following rules:

* The SYNOPSIS sections are left untouched.

* If the intent is that the user type the command exactly as given, it
  is `code`.
  If the user is only loosely referred to a command and/or option, it
  remains 'emphasised'.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 Documentation/config.txt            |   12 ++++++------
 Documentation/git-add.txt           |    2 +-
 Documentation/git-bisect.txt        |    2 +-
 Documentation/git-cvsserver.txt     |    2 +-
 Documentation/git-filter-branch.txt |    6 +++---
 Documentation/git-ls-tree.txt       |    4 ++--
 Documentation/git-merge.txt         |   14 +++++++-------
 Documentation/git-replace.txt       |    2 +-
 Documentation/git-revert.txt        |    4 ++--
 Documentation/git-stash.txt         |    2 +-
 Documentation/git-submodule.txt     |    4 ++--
 Documentation/git-var.txt           |    2 +-
 12 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 23a965e..6bfd9e1 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -741,15 +741,15 @@ diff.mnemonicprefix::
 	standard "a/" and "b/" depending on what is being compared.  When
 	this configuration is in effect, reverse diff output also swaps
 	the order of the prefixes:
-'git-diff';;
+`git diff`;;
 	compares the (i)ndex and the (w)ork tree;
-'git-diff HEAD';;
+`git diff HEAD`;;
 	 compares a (c)ommit and the (w)ork tree;
-'git diff --cached';;
+`git diff --cached`;;
 	compares a (c)ommit and the (i)ndex;
-'git-diff HEAD:file1 file2';;
+`git-diff HEAD:file1 file2`;;
 	compares an (o)bject and a (w)ork tree entity;
-'git diff --no-index a b';;
+`git diff --no-index a b`;;
 	compares two non-git things (1) and (2).
 
 diff.renameLimit::
@@ -1015,7 +1015,7 @@ gui.spellingdictionary::
 	off.
 
 gui.fastcopyblame::
-	If true, 'git gui blame' uses '-C' instead of '-C -C' for original
+	If true, 'git gui blame' uses `-C` instead of `-C -C` for original
 	location detection. It makes blame significantly faster on huge
 	repositories at the expense of less thorough copy detection.
 
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index 1f1b199..f74fcf3 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -39,7 +39,7 @@ The `git add` command will not add ignored files by default.  If any
 ignored files were explicitly specified on the command line, `git add`
 will fail with a list of ignored files.  Ignored files reached by
 directory recursion or filename globbing performed by Git (quote your
-globs before the shell) will be silently ignored.  The `add` command can
+globs before the shell) will be silently ignored.  The 'git add' command can
 be used to add ignored files with the `-f` (force) option.
 
 Please see linkgit:git-commit[1] for alternative ways to add content to a
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index c39d957..f91c7ac 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -26,7 +26,7 @@ on the subcommand:
  git bisect log
  git bisect run <cmd>...
 
-This command uses 'git rev-list --bisect' to help drive the
+This command uses `git rev-list --bisect` to help drive the
 binary search process to find which change introduced a bug, given an
 old "good" commit object name and a later "bad" commit object name.
 
diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt
index 99a7c14..19b1daf 100644
--- a/Documentation/git-cvsserver.txt
+++ b/Documentation/git-cvsserver.txt
@@ -294,7 +294,7 @@ To get a checkout with the Eclipse CVS client:
 Protocol notes: If you are using anonymous access via pserver, just select that.
 Those using SSH access should choose the 'ext' protocol, and configure 'ext'
 access on the Preferences->Team->CVS->ExtConnection pane. Set CVS_SERVER to
-"'git cvsserver'". Note that password support is not good when using 'ext',
+"`git cvsserver`". Note that password support is not good when using 'ext',
 you will definitely want to have SSH keys setup.
 
 Alternatively, you can just use the non-standard extssh protocol that Eclipse
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 394a77a..544836a 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -129,8 +129,8 @@ convenience functions, too.  For example, calling 'skip_commit "$@"'
 will leave out the current commit (but not its changes! If you want
 that, use 'git-rebase' instead).
 +
-You can also use the 'git_commit_non_empty_tree "$@"' instead of
-'git commit-tree "$@"' if you don't wish to keep commits with a single parent
+You can also use the `git_commit_non_empty_tree "$@"` instead of
+`git commit-tree "$@"` if you don't wish to keep commits with a single parent
 and that makes no change to the tree.
 
 --tag-name-filter <command>::
@@ -179,7 +179,7 @@ the nearest ancestor that was not excluded.
 	and only one parent, it will hence keep merges points. Also, this
 	option is not compatible with the use of '--commit-filter'. Though you
 	just need to use the function 'git_commit_non_empty_tree "$@"' instead
-	of the 'git commit-tree "$@"' idiom in your commit filter to make that
+	of the `git commit-tree "$@"` idiom in your commit filter to make that
 	happen.
 
 --original <namespace>::
diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
index c3fdccb..1f89d36 100644
--- a/Documentation/git-ls-tree.txt
+++ b/Documentation/git-ls-tree.txt
@@ -28,7 +28,7 @@ in the current working directory.  Note that:
    in a directory 'sub' that has a directory 'dir', you can run 'git
    ls-tree -r HEAD dir' to list the contents of the tree (that is
    'sub/dir' in 'HEAD').  You don't want to give a tree that is not at the
-   root level (e.g. 'git ls-tree -r HEAD:sub dir') in this case, as that
+   root level (e.g. `git ls-tree -r HEAD:sub dir`) in this case, as that
    would result in asking for 'sub/sub/dir' in the 'HEAD' commit.
    However, the current working directory can be ignored by passing
    --full-tree option.
@@ -84,7 +84,7 @@ Output Format
 
 Unless the `-z` option is used, TAB, LF, and backslash characters
 in pathnames are represented as `\t`, `\n`, and `\\`, respectively.
-This output format is compatible with what '--index-info --stdin' of
+This output format is compatible with what `--index-info --stdin` of
 'git update-index' expects.
 
 When the `-l` option is used, format changes to
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 3277f4e..04c21d3 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -193,7 +193,7 @@ After seeing a conflict, you can do two things:
 
  * Decide not to merge.  The only clean-ups you need are to reset
    the index file to the `HEAD` commit to reverse 2. and to clean
-   up working tree changes made by 2. and 3.; 'git-reset --hard' can
+   up working tree changes made by 2. and 3.; `git-reset --hard` can
    be used for this.
 
  * Resolve the conflicts.  Git will mark the conflicts in
@@ -202,19 +202,19 @@ After seeing a conflict, you can do two things:
 
 You can work through the conflict with a number of tools:
 
- * Use a mergetool.  'git mergetool' to launch a graphical
+ * Use a mergetool.  `git mergetool` to launch a graphical
    mergetool which will work you through the merge.
 
- * Look at the diffs.  'git diff' will show a three-way diff,
+ * Look at the diffs.  `git diff` will show a three-way diff,
    highlighting changes from both the HEAD and their versions.
 
- * Look at the diffs on their own. 'git log --merge -p <path>'
+ * Look at the diffs on their own. `git log --merge -p <path>`
    will show diffs first for the HEAD version and then
    their version.
 
- * Look at the originals.  'git show :1:filename' shows the
-   common ancestor, 'git show :2:filename' shows the HEAD
-   version and 'git show :3:filename' shows their version.
+ * Look at the originals.  `git show :1:filename` shows the
+   common ancestor, `git show :2:filename` shows the HEAD
+   version and `git show :3:filename` shows their version.
 
 
 EXAMPLES
diff --git a/Documentation/git-replace.txt b/Documentation/git-replace.txt
index 65a0da5..fde2092 100644
--- a/Documentation/git-replace.txt
+++ b/Documentation/git-replace.txt
@@ -65,7 +65,7 @@ OPTIONS
 BUGS
 ----
 Comparing blobs or trees that have been replaced with those that
-replace them will not work properly. And using 'git reset --hard' to
+replace them will not work properly. And using `git reset --hard` to
 go back to a replaced commit will move the branch to the replacement
 commit instead of the replaced commit.
 
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index 5e11758..36f3bc3 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -20,8 +20,8 @@ effect of an earlier commit (often a faulty one).  If you want to
 throw away all uncommitted changes in your working directory, you
 should see linkgit:git-reset[1], particularly the '--hard' option.  If
 you want to extract specific files as they were in another commit, you
-should see linkgit:git-checkout[1], specifically the 'git checkout
-<commit> -- <filename>' syntax.  Take care with these alternatives as
+should see linkgit:git-checkout[1], specifically the `git checkout
+<commit> -- <filename>` syntax.  Take care with these alternatives as
 both will discard uncommitted changes in your working directory.
 
 OPTIONS
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 3f14b72..f001d0e 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -20,7 +20,7 @@ SYNOPSIS
 DESCRIPTION
 -----------
 
-Use 'git stash' when you want to record the current state of the
+Use `git stash` when you want to record the current state of the
 working directory and the index, but want to go back to a clean
 working directory.  The command saves your local modifications away
 and reverts the working directory to match the `HEAD` commit.
diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 4ef70c4..68f656c 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -114,8 +114,8 @@ init::
 	The key used in .git/config is `submodule.$name.url`.
 	This command does not alter existing information in .git/config.
 	You can then customize the submodule clone URLs in .git/config
-	for your local setup and proceed to 'git submodule update';
-	you can also just use 'git submodule update --init' without
+	for your local setup and proceed to `git submodule update`;
+	you can also just use `git submodule update --init` without
 	the explicit 'init' step if you do not intend to customize
 	any submodule locations.
 
diff --git a/Documentation/git-var.txt b/Documentation/git-var.txt
index ef6aa81..bb98182 100644
--- a/Documentation/git-var.txt
+++ b/Documentation/git-var.txt
@@ -20,7 +20,7 @@ OPTIONS
 	Cause the logical variables to be listed. In addition, all the
 	variables of the git configuration file .git/config are listed
 	as well. (However, the configuration variables listing functionality
-	is deprecated in favor of 'git config -l'.)
+	is deprecated in favor of `git config -l`.)
 
 EXAMPLE
 --------
-- 
1.6.6.218.g502b0

^ permalink raw reply related

* Re: [PATCH v2 0/4] Documentation style fixes
From: Thomas Rast @ 2010-01-10  0:07 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jonathan Nieder
In-Reply-To: <cover.1263081032.git.trast@student.ethz.ch>

Thomas Rast wrote:
>   Documentation: spell 'git cmd' without dash throughout
[...]
>  115 files changed, 634 insertions(+), 626 deletions(-)

Turns out the fourth patch is over 200kB and can't be sent over the
list.  I pushed the whole series to

  git://repo.or.cz/git/sbeyer.git t/doc-merge-revamp

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

^ permalink raw reply

* Re: [PATCH v2 0/4] Documentation style fixes
From: Thomas Rast @ 2010-01-10  0:19 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jonathan Nieder
In-Reply-To: <201001100107.29920.trast@student.ethz.ch>

Thomas Rast wrote:
> Thomas Rast wrote:
> >   Documentation: spell 'git cmd' without dash throughout
> [...]
> >  115 files changed, 634 insertions(+), 626 deletions(-)
> 
> Turns out the fourth patch is over 200kB and can't be sent over the
> list.  I pushed the whole series to
> 
>   git://repo.or.cz/git/sbeyer.git t/doc-merge-revamp

Ah, here's the midnight issue.  That should have said

  git://repo.or.cz/git/trast.git t/doc-merge-revamp

Sorry for the noise.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

^ permalink raw reply

* Re: [PATCH v2 4/4] Documentation: spell 'git cmd' without dash throughout
From: Jonathan Nieder @ 2010-01-10  2:56 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, Junio C Hamano
In-Reply-To: <9516c897017ec420403bb7f687fb8962de42cb7c.1263081032.git.trast@student.ethz.ch>

Thomas Rast wrote:

> Replace 'git-cmd' with 'git cmd' throughout, except where git-shell,
> git-cvsserver, git-upload-pack, git-receive-pack, and
> git-upload-archive are concerned, because those really live in the
> $PATH.

Agreed.  Some forms of 'man' even support 'man git am', so the "it's
what you pass to 'man'" excuse does not even apply any more.

>  110 files changed, 584 insertions(+), 584 deletions(-)

But yikes!  Did you do this by hand or by some automated process?

> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 6bfd9e1..db28408 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -64,7 +64,7 @@ The values following the equals sign in variable assign are all either
>  a string, an integer, or a boolean.  Boolean values may be given as yes/no,
>  0/1, true/false or on/off.  Case is not significant in boolean values, when
>  converting value to the canonical form using '--bool' type specifier;
> -'git-config' will ensure that the output is "true" or "false".
> +'git config' will ensure that the output is "true" or "false".
>  
>  String values may be entirely or partially enclosed in double quotes.
>  You need to enclose variable values in double quotes if you want to
> @@ -442,7 +442,7 @@ core.pager::
>  
>  core.whitespace::
>  	A comma separated list of common whitespace problems to
> -	notice.  'git-diff' will use `color.diff.whitespace` to
> +	notice.  'git diff' will use `color.diff.whitespace` to
>  	highlight them, and 'git-apply --whitespace=error' will

A 'git-apply' snuck in. ;-)

> @@ -563,24 +563,24 @@ branch.autosetuprebase::
[...]
>  	Specify multiple values to get an octopus merge.
> -	If you wish to setup 'git-pull' so that it merges into <name> from
> +	If you wish to setup 'git pull' so that it merges into <name> from

Not relevant to this patch, but shouldn't ‘setup’ be ‘set up’?

> @@ -718,14 +718,14 @@ commit.template::
>  	specified user's home directory.
>  
>  diff.autorefreshindex::
> -	When using 'git-diff' to compare with work tree
> +	When using 'git diff' to compare with work tree
>  	files, do not consider stat-only change as changed.
>  	Instead, silently run `git update-index --refresh` to
>  	update the cached stat information for paths whose
>  	contents in the work tree match the contents in the
>  	index.  This option defaults to true.  Note that this
> -	affects only 'git-diff' Porcelain, and not lower level
> -	'diff' commands, such as 'git-diff-files'.
> +	affects only 'git diff' Porcelain, and not lower level
> +	'diff' commands, such as 'git diff-files'.

This sounds better to me without the comma before ‘such as’.

> @@ -840,7 +840,7 @@ format.pretty::
>  	linkgit:git-whatchanged[1].
>  
>  format.thread::
> -	The default threading style for 'git-format-patch'.  Can be
> +	The default threading style for 'git format-patch'.  Can be
>  	either a boolean value, `shallow` or `deep`.  `shallow`
>  	threading makes every mail a reply to the head of the series,
>  	where the head is chosen from the cover letter, the

The ‘either’ here sounds awkward, because there are three options.
Also it is not completely clear that ‘shallow’ and ‘deep’ are not
boolean values here.  So maybe ‘Can be a boolean value, or shallow or
deep’, despite the awkward nested ‘or’ expression.

> @@ -875,18 +875,18 @@ gc.autopacklimit::
>  	default	value is 50.  Setting this to 0 disables it.
>  
>  gc.packrefs::
> -	'git-gc' does not run `git pack-refs` in a bare repository by
> +	'git gc' does not run `git pack-refs` in a bare repository by
>  	default so that older dumb-transport clients can still fetch
> -	from the repository.  Setting this to `true` lets 'git-gc'
> +	from the repository.  Setting this to `true` lets 'git gc'
>  	to run `git pack-refs`.  Setting this to `false` tells

Should be ‘lets git gc run’ or ‘tells git gc to run’.  Not to mention
this is not true any more: 'git gc' has run pack-refs by default ever
since commit 56752391 (Make "git gc" pack all refs by default,
2007-05-24).  As that commit message mentions, git versions before
v1.5.1.2 cannot clone repos with packed refs over http, and git
versions before v1.4.4 cannot handled packed refs period, but more
recent git should have no problems.

So to summarize, the changes to config.txt look good, except a
‘git-apply’ snuck past.

The other changes mentioned above follow.

  Documentation: config: git gc packs refs by default now
  Documentation: tiny git config manual tweaks

 Documentation/config.txt |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

^ permalink raw reply

* [PATCH 1/2] Documentation: git gc packs refs by default now
From: Jonathan Nieder @ 2010-01-10  2:59 UTC (permalink / raw)
  To: git; +Cc: Thomas Rast, Junio C Hamano
In-Reply-To: <20100110025641.GB1083@progeny.tock>

In commit 56752391 (Make "git gc" pack all refs by default,
2007-05-24), 'git gc' was changed to run pack-refs by default 

Versions before v1.5.1.2 cannot clone repos with packed refs over
http, and versions before v1.4.4 cannot handled packed refs at
all, but more recent git should have no problems.  Try to make
this more clear in the git-config manual.

The analagous passage in git-gc.txt was updated already with
commit fe2128a (Change git-gc documentation to reflect
gc.packrefs implementation., 2008-01-09).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Documentation/config.txt |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index b5b27ba..bcfed1c 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -875,15 +875,12 @@ gc.autopacklimit::
 	default	value is 50.  Setting this to 0 disables it.
 
 gc.packrefs::
-	'git-gc' does not run `git pack-refs` in a bare repository by
-	default so that older dumb-transport clients can still fetch
-	from the repository.  Setting this to `true` lets 'git-gc'
-	to run `git pack-refs`.  Setting this to `false` tells
-	'git-gc' never to run `git pack-refs`. The default setting is
-	`notbare`. Enable it only when you know you do not have to
-	support such clients.  The default setting will change to `true`
-	at some stage, and setting this to `false` will continue to
-	prevent `git pack-refs` from being run from 'git-gc'.
+	Running `git pack-refs` in a repository renders it
+	unclonable by Git versions prior to 1.5.1.2 over dumb
+	transports such as HTTP.  This variable determines whether
+	'git gc' runs `git pack-refs`. This can be set to "nobare"
+	to enable it within all non-bare repos or it can be set to a
+	boolean value.  The default is `true`.
 
 gc.pruneexpire::
 	When 'git-gc' is run, it will call 'prune --expire 2.weeks.ago'.
-- 
1.6.6

^ permalink raw reply related

* [PATCH 2/2] Documentation: tiny git config manual tweaks
From: Jonathan Nieder @ 2010-01-10  3:01 UTC (permalink / raw)
  To: git; +Cc: Thomas Rast, Junio C Hamano
In-Reply-To: <20100110025641.GB1083@progeny.tock>

As a verb, 'setup' is spelled 'set up'.  “diff commands such as
diff-files” scans better without a comma.  Clarify that shallow
and deep are special non-boolean values for format.thread rather
than boolean values with some other name.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Documentation/config.txt |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index bcfed1c..f7728ec 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -537,7 +537,7 @@ apply.whitespace::
 	as the '--whitespace' option. See linkgit:git-apply[1].
 
 branch.autosetupmerge::
-	Tells 'git-branch' and 'git-checkout' to setup new branches
+	Tells 'git-branch' and 'git-checkout' to set up new branches
 	so that linkgit:git-pull[1] will appropriately merge from the
 	starting point branch. Note that even if this option is not set,
 	this behavior can be chosen per-branch using the `--track`
@@ -725,7 +725,7 @@ diff.autorefreshindex::
 	contents in the work tree match the contents in the
 	index.  This option defaults to true.  Note that this
 	affects only 'git-diff' Porcelain, and not lower level
-	'diff' commands, such as 'git-diff-files'.
+	'diff' commands such as 'git-diff-files'.
 
 diff.external::
 	If this config variable is set, diff generation is not
@@ -841,8 +841,8 @@ format.pretty::
 
 format.thread::
 	The default threading style for 'git-format-patch'.  Can be
-	either a boolean value, `shallow` or `deep`.  `shallow`
-	threading makes every mail a reply to the head of the series,
+	a boolean value, or `shallow` or `deep`.  `shallow` threading
+	makes every mail a reply to the head of the series,
 	where the head is chosen from the cover letter, the
 	`\--in-reply-to`, and the first patch mail, in this order.
 	`deep` threading makes every mail a reply to the previous one.
-- 
1.6.6

^ permalink raw reply related

* Re: [PATCH v2 3/4] Documentation: format full commands in typewriter font
From: Jonathan Nieder @ 2010-01-10  3:31 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, Junio C Hamano
In-Reply-To: <9d10ee6a8526dc9f9c220cc6bb4b509c8cc73b0a.1263081032.git.trast@student.ethz.ch>

Thomas Rast wrote:
> * If the intent is that the user type the command exactly as given, it
>   is `code`.
>   If the user is only loosely referred to a command and/or option, it
>   remains 'emphasised'.

Okay.  I think I was guilty of pushing this convention (in commits
like 2fd02c92).  If the distinction is too hazy to be useful, I think
it would be fine to always use `code`, though that would be a bigger
patch.

> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 23a965e..6bfd9e1 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -741,15 +741,15 @@ diff.mnemonicprefix::
>  	standard "a/" and "b/" depending on what is being compared.  When
>  	this configuration is in effect, reverse diff output also swaps
>  	the order of the prefixes:
> -'git-diff';;
> +`git diff`;;
>  	compares the (i)ndex and the (w)ork tree;
> -'git-diff HEAD';;
> +`git diff HEAD`;;
>  	 compares a (c)ommit and the (w)ork tree;
> -'git diff --cached';;
> +`git diff --cached`;;
>  	compares a (c)ommit and the (i)ndex;
> -'git-diff HEAD:file1 file2';;
> +`git-diff HEAD:file1 file2`;;

Shouldn't this use ‘git diff’ (no hyphen)?  Alternatively, if you are
leaving this for the next commit, should the other 'git-diff' lines
keep their dash until then, too?

> diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
> index c39d957..f91c7ac 100644
> --- a/Documentation/git-bisect.txt
> +++ b/Documentation/git-bisect.txt
> @@ -26,7 +26,7 @@ on the subcommand:
>   git bisect log
>   git bisect run <cmd>...
>  
> -This command uses 'git rev-list --bisect' to help drive the
> +This command uses `git rev-list --bisect` to help drive the

Does rev-list --bisect take more arguments (i.e., isn’t the command
being only loosely referred to here)?

> diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
> index 394a77a..544836a 100644
> --- a/Documentation/git-filter-branch.txt
> +++ b/Documentation/git-filter-branch.txt
> @@ -129,8 +129,8 @@ convenience functions, too.  For example, calling 'skip_commit "$@"'
>  will leave out the current commit (but not its changes! If you want
>  that, use 'git-rebase' instead).
>  +
> -You can also use the 'git_commit_non_empty_tree "$@"' instead of
> -'git commit-tree "$@"' if you don't wish to keep commits with a single parent
> +You can also use the `git_commit_non_empty_tree "$@"` instead of
> +`git commit-tree "$@"` if you don't wish to keep commits with a single parent
>  and that makes no change to the tree.

Not this commit’s topic, but perhaps ‘use the ...’ should be ‘use ...’
or ‘use the ... idiom’...

>  --tag-name-filter <command>::
> @@ -179,7 +179,7 @@ the nearest ancestor that was not excluded.
>  	and only one parent, it will hence keep merges points. Also, this
>  	option is not compatible with the use of '--commit-filter'. Though you
>  	just need to use the function 'git_commit_non_empty_tree "$@"' instead
> -	of the 'git commit-tree "$@"' idiom in your commit filter to make that
> +	of the `git commit-tree "$@"` idiom in your commit filter to make that
>  	happen.

... to match this.

> diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
> index 3277f4e..04c21d3 100644
> --- a/Documentation/git-merge.txt
> +++ b/Documentation/git-merge.txt
> @@ -193,7 +193,7 @@ After seeing a conflict, you can do two things:
>  
>   * Decide not to merge.  The only clean-ups you need are to reset
>     the index file to the `HEAD` commit to reverse 2. and to clean
> -   up working tree changes made by 2. and 3.; 'git-reset --hard' can
> +   up working tree changes made by 2. and 3.; `git-reset --hard` can

Probably `git reset --hard` (I won’t mention any more of these).

Except for the bisect-change above,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

The rest looks good, and really does seem clearer in some places.

Thanks,
Jonathan

^ permalink raw reply

* [PATCH 1/4] difftool--helper: Update copyright and remove distracting comments
From: David Aguilar @ 2010-01-10  4:02 UTC (permalink / raw)
  To: gitster; +Cc: git, markus.heidelberg

Some of the comments in git-difftool--helper are not needed because
the code is sufficiently readable without them.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-difftool--helper.sh |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 57e8e32..1b13808 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -3,9 +3,8 @@
 # This script is typically launched by using the 'git difftool'
 # convenience command.
 #
-# Copyright (c) 2009 David Aguilar
+# Copyright (c) 2009-2010 David Aguilar
 
-# Load common functions from git-mergetool--lib
 TOOL_MODE=diff
 . git-mergetool--lib
 
@@ -20,7 +19,6 @@ should_prompt () {
 	fi
 }
 
-# Sets up shell variables and runs a merge tool
 launch_merge_tool () {
 	# Merged is the filename as it appears in the work tree
 	# Local is the contents of a/filename
@@ -39,7 +37,6 @@ launch_merge_tool () {
 		read ans
 	fi
 
-	# Run the appropriate merge tool command
 	run_merge_tool "$merge_tool"
 }
 
-- 
1.6.6.4.g20a38b.dirty

^ permalink raw reply related

* [PATCH 2/4] difftool--helper: Remove use of the GIT_MERGE_TOOL variable
From: David Aguilar @ 2010-01-10  4:02 UTC (permalink / raw)
  To: gitster; +Cc: git, markus.heidelberg
In-Reply-To: <1263096163-15743-1-git-send-email-davvid@gmail.com>

An undocumented mis-feature in git-difftool is that it allows you
to specify a default difftool by setting GIT_MERGE_TOOL.
This behavior was never documented and was included as an
oversight back when git-difftool was maintained outside of git.

git-mergetool never honored GIT_MERGE_TOOL so neither should
git-difftool.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-difftool--helper.sh |    9 ++++-----
 t/t7800-difftool.sh     |    9 ---------
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 1b13808..3621f28 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -40,11 +40,10 @@ launch_merge_tool () {
 	run_merge_tool "$merge_tool"
 }
 
-# Allow GIT_DIFF_TOOL and GIT_MERGE_TOOL to provide default values
-test -n "$GIT_MERGE_TOOL" && merge_tool="$GIT_MERGE_TOOL"
-test -n "$GIT_DIFF_TOOL" && merge_tool="$GIT_DIFF_TOOL"
-
-if test -z "$merge_tool"; then
+# GIT_DIFF_TOOL indicates that --tool=... was specified
+if test -n "$GIT_DIFF_TOOL"; then
+	merge_tool="$GIT_DIFF_TOOL"
+else
 	merge_tool="$(get_merge_tool)" || exit
 fi
 
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 9bf6c98..eca51a8 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -32,7 +32,6 @@ restore_test_defaults()
 	# Restores the test defaults used by several tests
 	remove_config_vars
 	unset GIT_DIFF_TOOL
-	unset GIT_MERGE_TOOL
 	unset GIT_DIFFTOOL_PROMPT
 	unset GIT_DIFFTOOL_NO_PROMPT
 	git config diff.tool test-tool &&
@@ -107,15 +106,7 @@ test_expect_success 'GIT_DIFF_TOOL overrides' '
 	git config diff.tool bogus-tool &&
 	git config merge.tool bogus-tool &&
 
-	GIT_MERGE_TOOL=test-tool &&
-	export GIT_MERGE_TOOL &&
-	diff=$(git difftool --no-prompt branch) &&
-	test "$diff" = "branch" &&
-	unset GIT_MERGE_TOOL &&
-
-	GIT_MERGE_TOOL=bogus-tool &&
 	GIT_DIFF_TOOL=test-tool &&
-	export GIT_MERGE_TOOL &&
 	export GIT_DIFF_TOOL &&
 
 	diff=$(git difftool --no-prompt branch) &&
-- 
1.6.6.4.g20a38b.dirty

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox