Git development
 help / color / mirror / Atom feed
* You have local changes; cannot switch branches error question
From: Eugene Sajine @ 2009-12-24 22:25 UTC (permalink / raw)
  To: git; +Cc: Eugene Sajine

First of all Merry Christmas and Happy New Year to everybody! I wish
Git to move to global dominance during next year even faster then it
does now;)

My question is related to the fact that most of the time when i have
some local file changes Git is switching branches OK. But from time to
time in some repos I'm hitting this error and I cannot figure out why
it suddenly starts to complain about it?

For example in one of my repos I somehow got to a state when I have
three files modified, and when I'm trying to switch branches it
complains about one of them being changed locally, so it refuses to
switch branch

OTOH i have tried many different scenarios in another repo to leave
some uncommitted staged or not staged  changes and switch branches and
same version of git does that just fine. (v 1.6.5.6).

So, what is correct behavior - do not switch or switch branches when
there are uncommitted changes?

Thanks,
Eugene

^ permalink raw reply

* Re: Some stats for 1.6.6
From: Shawn O. Pearce @ 2009-12-24 19:43 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano
In-Reply-To: <7v637wjlor.fsf@alter.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> wrote:
> Here is a contributor statistics.
> 
>       release new     this    total   date
>       v0.99   47      47      47      2005-07-10
...
>       v1.6.5  27      101     693     2009-10-10
>       v1.6.6  17      99      710     2009-12-23
> 
> During the entire history leading to 1.6.6, 710 authors contributed code
> and documentation.  The changes since 1.6.5 were made by 99 authors, among
> which 17 are the new contributors to the project.

This is what impresses me most about Git.

Its not our simple on disk format, or our network protocols, or how
well we have been able to avoid breaking things.  Its our community.

Almost 100 people contributed code into the most recent release,
and in just the last 6 months we picked up 44 new contributors.

I wish all open source projects ran this well.

> Let's thank and welcome them to the community(sorted LC_ALL=C): Andrew
> Myrick, Brian Collins, Carlos R. Mafra, Dan Zwell, Erick Mattos, Gisle
> Aas, Guillermo S. Romero, Jean Privat, Jimmy Angelakos, Jindrich
> Makovicka, Mizar, Nasser Grainawi, Pauli Virtanen, Raman Gupta, Robert
> Zeh, Tim Henigan, and Vietor Liu.

Welcome!  But more importantly, thank you for making Git better!

:-)

-- 
Shawn.

^ permalink raw reply

* Some stats for 1.6.6
From: Junio C Hamano @ 2009-12-24 18:01 UTC (permalink / raw)
  To: git
In-Reply-To: <7vpr65kwnt.fsf@alter.siamese.dyndns.org>

Now 1.6.6 is out, the next one will be 1.7.0 that hopefully will happen
sometime late in February 2010.  I wish people happy holidays, and expect
them to slow down (I would ;-) for the remainder of the year.

Here are a few sets of numbers to help relax your mind away from hacking.

The very initial release of "git" consisted of 11 files, 1244 lines in
total, all written by Linus.  Here is the result of a "reverse-blame" that
counts how much of that original version still can be found in the latest
version:

   surviving     original path (survival%)
          16           40 Makefile (40.00%)
          16          168 README (9.52%)
          54           93 cache.h (58.06%)
           4           23 cat-file.c (17.39%)
           6          172 commit-tree.c (3.48%)
           4           51 init-db.c (7.84%)
          99          259 read-cache.c (38.22%)
           0           43 read-tree.c (0.00%)
           7           81 show-diff.c (8.64%)
          39          248 update-cache.c (15.72%)
           0           66 write-tree.c (0.00%)
         245         1244 Total (19.69%)

As can be seen in "cache.h", the very basic data structures and accessor
methods haven't changed much.  v0.99, which was the last version Linus
tagged before handing the development over to me, still retained 46% of
the original.

Here is a contributor statistics.

      release new     this    total   date
      v0.99   47      47      47      2005-07-10
      v1.0.0  68      89      115     2005-12-21
      v1.1.0  4       19      119     2006-01-08
      v1.2.0  8       32      127     2006-02-12
      v1.3.0  22      56      149     2006-04-18
      v1.4.0  18      57      167     2006-06-10
      v1.4.1  3       30      170     2006-07-01
      v1.4.2  13      47      183     2006-08-12
      v1.4.3  9       43      192     2006-10-18
      v1.4.4  8       42      200     2006-11-14
      v1.5.0  25      72      225     2007-02-14
      v1.5.1  14      59      239     2007-04-03
      v1.5.2  19      70      258     2007-05-20
      v1.5.3  53      126     311     2007-09-02
      v1.5.4  82      163     393     2008-02-01
      v1.5.5  33      112     426     2008-04-07
      v1.5.6  46      114     472     2008-06-18
      v1.6.0  40      105     512     2008-08-17
      v1.6.1  49      147     561     2008-12-24
      v1.6.2  34      109     595     2009-03-03
      v1.6.3  45      117     640     2009-05-06
      v1.6.4  26      98      666     2009-07-29
      v1.6.5  27      101     693     2009-10-10
      v1.6.6  17      99      710     2009-12-23

During the entire history leading to 1.6.6, 710 authors contributed code
and documentation.  The changes since 1.6.5 were made by 99 authors, among
which 17 are the new contributors to the project.

Let's thank and welcome them to the community(sorted LC_ALL=C): Andrew
Myrick, Brian Collins, Carlos R. Mafra, Dan Zwell, Erick Mattos, Gisle
Aas, Guillermo S. Romero, Jean Privat, Jimmy Angelakos, Jindrich
Makovicka, Mizar, Nasser Grainawi, Pauli Virtanen, Raman Gupta, Robert
Zeh, Tim Henigan, and Vietor Liu.

^ permalink raw reply

* [RFC PATCH 1/2] Report exec errors from run-command
From: Ilari Liusvaara @ 2009-12-24 17:49 UTC (permalink / raw)
  To: git
In-Reply-To: <1261676971-3285-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.

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: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
---
 run-command.c |   72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 69 insertions(+), 3 deletions(-)

diff --git a/run-command.c b/run-command.c
index cf2d8f7..d334d0f 100644
--- a/run-command.c
+++ b/run-command.c
@@ -76,9 +76,60 @@ fail_pipe:
 	trace_argv_printf(cmd->argv, "trace: run_command:");
 
 #ifndef WIN32
+{
+	int report_pipe[2] = {-1, -1};
+
+	if (pipe(report_pipe) < 0)
+		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;
+		while(close(report_pipe[1]) < 0 && errno != EBADF);
+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.
+			 */
+wait_again:
+			r = waitpid(cmd->pid, &ret, 0);
+			if (r < 0 && errno != ECHILD)
+				goto wait_again;
+			cmd->pid = -1;
+		}
+	} else if (!cmd->pid) {
+		int r = 0;
+		int flags;
+		while(close(report_pipe[0]) < 0 && errno != EBADF);
+
+		flags = fcntl(report_pipe[1], F_GETFD);
+		if (flags < 0)
+			r = -1;
+		flags |= FD_CLOEXEC;
+		r = (r || fcntl(report_pipe[1], F_SETFD, flags));
+		if (r) {
+			warning("Can't FD_CLOEXEC pipe for exec status "
+				"report: %s\n", strerror(errno));
+			while(close(report_pipe[1]) < 0 && errno != EBADF);
+			report_pipe[1] = -1;
+		}
+
 		if (cmd->no_stdin)
 			dup_devnull(0);
 		else if (need_in) {
@@ -126,13 +177,28 @@ 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));
+
+		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;
+		else if (r < 0)
+			warning("Can't write exec status report: %s\n",
+				strerror(errno));
+
 		exit(127);
-	}
-	if (cmd->pid < 0)
+	} 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 */
-- 
1.6.6.3.gaa2e1

^ permalink raw reply related

* [RFC PATCH 2/2] Improve transport helper exec failure reporting
From: Ilari Liusvaara @ 2009-12-24 17:49 UTC (permalink / raw)
  To: git
In-Reply-To: <1261676971-3285-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 |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/transport-helper.c b/transport-helper.c
index 5078c71..0965c9b 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -31,13 +31,19 @@ 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] = transport->url;
-	helper->git_cmd = 1;
-	if (start_command(helper))
-		die("Unable to run helper: git %s", helper->argv[0]);
+	helper->git_cmd = 0;
+	if (start_command(helper)) {
+		if (errno == ENOENT)
+			die("Unable to find remote helper for \"%s\"",
+				data->name);
+		else
+			die("Unable to run helper %s: %s", helper->argv[0],
+				strerror(errno));
+	}
 	data->helper = helper;
 
 	write_str_in_full(helper->in, "capabilities\n");
-- 
1.6.6.3.gaa2e1

^ permalink raw reply related

* [RFC PATCH 0/2] Report remote helper exec failures
From: Ilari Liusvaara @ 2009-12-24 17:49 UTC (permalink / raw)
  To: git

Actually give useful error messages if executing git remote helper fails
for some reason.

The previous error message was:

git: 'remote-fail' is not a git-command. See 'git --help'

This changes the error message to:

'Unable to find remote helper for "nonexistent"'

or

'Unable to run helper HelperThatGetsEACCESS: Permission denied' 
(or whatever the errno is).


Patch series is based on v1.6.6.

One of the changes is adjacent to changes in external helper dispatch
support change and gets merge conflict. Here's how I resolved that
conflict for testing:

        helper->argv[2] = remove_ext_force(transport->url);
        helper->git_cmd = 0;
        if (start_command(helper)) {
                if (errno == ENOENT)
                        die("Unable to find remote helper for \"%s\"",
                                data->name);
                else
                        die("Unable to run helper %s: %s", helper->argv[0],
                                strerror(errno));
        }

The first line in that comes from dispatch support and the rest come from
exec failure reporting.


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

 run-command.c      |   72 +++++++++++++++++++++++++++++++++++++++++++++++++--
 transport-helper.c |   14 +++++++---
 2 files changed, 79 insertions(+), 7 deletions(-)

^ permalink raw reply

* Re: elegant(?) debian topgit workflow?
From: David Greaves @ 2009-12-24 16:34 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: thomas, debian-devel, git, vcs-pkg-discuss
In-Reply-To: <94a0d4530912240714y798085d8r3bf88011e8ec782b@mail.gmail.com>

Felipe Contreras wrote:
> On Wed, Dec 16, 2009 at 12:13 PM, Thomas Koch <thomas@koch.ro> wrote:
>> branches
>> --------
>>
>> upstream
> 
> I would call it 'master'. That's how upstream would call it.
> 
>> debian/*, fixes/*, features/* - topgit branches based on upstream
>> patches - the hero
>> master - contains the debian/ dir and is the branch we build from
> 
> Think about other systems, like Ubuntu and Maemo, it would be nice to
> have branches both for Maemo and Debian on the same repo:
> debian - what you call 'master'
> debian-patches - what you call 'patches'
> maemo5 - contains the debian/ dir, but for Maemo 5
> maemo5-patches - patches for Maemo 5, might be based on top of debian-patches

I've been touting for feedback on this for a while :)

http://wiki.maemo.org/Mer/Build/UsingGitorious

David

-- 
"Don't worry, you'll be fine; I saw it work in a cartoon once..."

^ permalink raw reply

* Re: elegant(?) debian topgit workflow?
From: Felipe Contreras @ 2009-12-24 15:14 UTC (permalink / raw)
  To: thomas; +Cc: vcs-pkg-discuss, git, debian-devel
In-Reply-To: <200912161113.38396.thomas@koch.ro>

On Wed, Dec 16, 2009 at 12:13 PM, Thomas Koch <thomas@koch.ro> wrote:
> branches
> --------
>
> upstream

I would call it 'master'. That's how upstream would call it.

> debian/*, fixes/*, features/* - topgit branches based on upstream
> patches - the hero
> master - contains the debian/ dir and is the branch we build from

Think about other systems, like Ubuntu and Maemo, it would be nice to
have branches both for Maemo and Debian on the same repo:
debian - what you call 'master'
debian-patches - what you call 'patches'
maemo5 - contains the debian/ dir, but for Maemo 5
maemo5-patches - patches for Maemo 5, might be based on top of debian-patches

-- 
Felipe Contreras

^ permalink raw reply

* Re: Patch which adds syslog support to git-shell
From: Erik Faye-Lund @ 2009-12-24 13:03 UTC (permalink / raw)
  To: Gerhard Gappmeier; +Cc: git
In-Reply-To: <40aa078e0912240338g7765d17cyf948650deab2aa01@mail.gmail.com>

On Thu, Dec 24, 2009 at 12:38 PM, Erik Faye-Lund
<kusmabite@googlemail.com> wrote:
> Anyway, this is all I bother to point out before I see an inlined,
> white-space fixed patch.
>

Actually, I'll add one thing: using syslog in git-shell breaks the
Windows builds. I don't know about other platforms.

Currently, git-daemon is the only git-program that depends on syslog,
and it's excluded from Windows builds (but this is something that
might change soon).

-- 
Erik "kusma" Faye-Lund

^ permalink raw reply

* Re: Patch which adds syslog support to git-shell
From: Erik Faye-Lund @ 2009-12-24 11:38 UTC (permalink / raw)
  To: Gerhard Gappmeier; +Cc: git
In-Reply-To: <200912231832.03541.gerhard.gappmeier@ascolab.com>

Please read Documentation/SubmittingPatches. We prefer inline patches,
as they are easier to review.

On Wed, Dec 23, 2009 at 6:32 PM, Gerhard Gappmeier
<gerhard.gappmeier@ascolab.com> wrote:
> Hi
>
> I'm not sure if this is the right list, but here is my first GIT patch.
>

It's the right list :)

> I had a problem with git-shell and wanted to analyze it.
> Unfortunately it does not contain any trace capabilities.
> So I cloned git and added some basic syslog support.
> After that I recognized that the current git version just works ;-)
> but the syslog functionality is always a nice thing I think.
> So here is the patch.

Looking at your patch, I see there's a lot of white-space changes. Stuff like:

> -	const char *cvsserver_argv[3] = {
> -		"cvsserver", "server", NULL
> -	};
> +    const char *cvsserver_argv[3] = {
> +        "cvsserver", "server", NULL
> +    };

just makes this harder to review. Besides, we use tabs for indentation in git.

Also, I think it would be better to use set_die_routine() from usage.h
than to change all the die call-sites. This is what git-daemon does:

--->8---
	if (log_syslog) {
		openlog("git-daemon", LOG_PID, LOG_DAEMON);
		set_die_routine(daemon_die);
	}
--->8---
Look at daemon.c for the implementation of daemon_die().

+/* Syslog defines */
+#define GIT_SYSLOG_IDENT    "git-shell"
+#define GIT_SYSLOG_OPTION   0
+#define GIT_SYSLOG_FACILITY LOG_LOCAL0
+

Is this really needed? These are only used at one place. Just doing
+    openlog("git-shell", 0, LOG_LOCAL0);
would IMO be cleaner.

Anyway, this is all I bother to point out before I see an inlined,
white-space fixed patch.

> Merry X-Mas.

Happy holidays to you too :)

-- 
Erik "kusma" Faye-Lund

^ permalink raw reply

* [Squash PATCH] fprintf(stderr, "Warning...") -> warning("...")
From: Ilari Liusvaara @ 2009-12-24 10:41 UTC (permalink / raw)
  To: git

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

This fixes the small nit about fprintf(stderr, "Warning: ") by using
warning() API. 

It can be appiled on top of "Support remote helpers implementing smart
transports" or squashed to it.

diff --git a/transport-helper.c b/transport-helper.c
index 55427df..8c8ca8e 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -420,11 +420,10 @@ static int process_connect_service(struct transport *transport,
 	if (strcmp(name, exec)) {
 		r = set_helper_option(transport, "servpath", exec);
 		if (r > 0)
-			fprintf(stderr, "Warning: Setting remote service path "
-				"not supported by protocol.\n");
+			warning("Setting remote service path not supported "
+				"by protocol.\n");
 		else if (r < 0)
-			fprintf(stderr, "Warning: Invalid remote service "
-				"path.\n");
+			warning("Invalid remote service path.\n");
 	}
 
 	if (data->connect)
-- 
1.6.6.3.gaa2e1

^ permalink raw reply related

* [PATCH v3 1/6] t5541-http-push.sh: add tests for non-fast-forward pushes
From: Tay Ray Chuan @ 2009-12-24  7:40 UTC (permalink / raw)
  To: git; +Cc: Shawn O. Pearce, Daniel Barkalow, Jeff King, Junio C Hamano
In-Reply-To: <20091224154005.a642c8ec.rctay89@gmail.com>

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 t/t5541-http-push.sh |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index 2a58d0c..f49c7c4 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -88,5 +88,28 @@ test_expect_success 'used receive-pack service' '
 	test_cmp exp act
 '

+test_expect_success 'non-fast-forward push fails' '
+	cd "$ROOT_PATH"/test_repo_clone &&
+	git checkout master &&
+	echo "changed" > path2 &&
+	git commit -a -m path2 --amend &&
+
+	HEAD=$(git rev-parse --verify HEAD) &&
+	!(git push -v origin >output 2>&1) &&
+	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
+	 test $HEAD != $(git rev-parse --verify HEAD))
+'
+
+test_expect_failure 'non-fast-forward push show ref status' '
+	grep "^ ! \[rejected\][ ]*master -> master (non-fast-forward)$" output
+'
+
+test_expect_failure 'non-fast-forward push shows help message' '
+	grep \
+"To prevent you from losing history, non-fast-forward updates were rejected
+Merge the remote changes before pushing again.  See the '"'non-fast-forward'"'
+section of '"'git push --help'"' for details." output
+'
+
 stop_httpd
 test_done
--
1.6.6.rc1.249.g048b3

^ permalink raw reply related

* [PATCH v3 6/6] transport-helper.c::push_refs(): emit "no refs" error message
From: Tay Ray Chuan @ 2009-12-24  7:45 UTC (permalink / raw)
  To: git; +Cc: Shawn O. Pearce, Daniel Barkalow, Jeff King, Junio C Hamano
In-Reply-To: <20091224154445.ad4b7a01.rctay89@gmail.com>

Emit an error message when remote_refs is not set.

This behaviour is consistent with that of builtin-send-pack.c and
http-push.c.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---

Changed nothing from v2.

 transport-helper.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/transport-helper.c b/transport-helper.c
index bdfa07e..5910384 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -321,8 +321,11 @@ static int push_refs(struct transport *transport,
 	struct child_process *helper;
 	struct ref *ref;

-	if (!remote_refs)
+	if (!remote_refs) {
+		fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
+			"Perhaps you should specify a branch such as 'master'.\n");
 		return 0;
+	}

 	helper = get_helper(transport);
 	if (!data->push)
--
1.6.6.rc1.249.g048b3

^ permalink raw reply related

* [PATCH v3 5/6] transport-helper.c::push_refs(): ignore helper-reported status if ref is not to be pushed
From: Tay Ray Chuan @ 2009-12-24  7:44 UTC (permalink / raw)
  To: git; +Cc: Shawn O. Pearce, Daniel Barkalow, Jeff King, Junio C Hamano
In-Reply-To: <20091224154352.ecefd242.rctay89@gmail.com>

If the status of a ref is REF_STATUS_REJECT_NONFASTFORWARD or
REF_STATUS_UPTODATE, the remote helper will not be told to push the ref
(via a 'push' command).

Therefore, if a ref is not to be pushed, ignore the status report by the
remote helper for that ref - don't overwrite the status of the ref with
the status reported by the helper, nor the message in the remote_status
member.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 t/t5541-http-push.sh |    2 +-
 transport-helper.c   |   14 ++++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index fee9494..79867bc 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -111,7 +111,7 @@ Merge the remote changes before pushing again.  See the '"'non-fast-forward'"'
 section of '"'git push --help'"' for details." output
 '

-test_expect_failure 'push fails for non-fast-forward refs unmatched by remote helper' '
+test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper' '
 	# create a dissimilarly-named ref so that git is unable to match the refs
 	git push origin master:retsam

diff --git a/transport-helper.c b/transport-helper.c
index 6b1f778..bdfa07e 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -429,8 +429,18 @@ static int push_refs(struct transport *transport,
 			continue;
 		}

-		ref->status = status;
-		ref->remote_status = msg;
+		switch (ref->status) {
+		case REF_STATUS_REJECT_NONFASTFORWARD:
+		case REF_STATUS_UPTODATE:
+			/*
+			 * Earlier, the ref was marked not to be pushed, so ignore what
+			 * the remote helper said about the ref.
+			 */
+			continue;
+		default:
+			ref->status = status;
+			ref->remote_status = msg;
+		}
 	}
 	strbuf_release(&buf);
 	return 0;
--
1.6.6.rc1.249.g048b3

^ permalink raw reply related

* [PATCH v3 4/6] transport.c::transport_push(): make ref status affect return value
From: Tay Ray Chuan @ 2009-12-24  7:43 UTC (permalink / raw)
  To: git; +Cc: Shawn O. Pearce, Daniel Barkalow, Jeff King, Junio C Hamano
In-Reply-To: <20091224154258.08b4fe44.rctay89@gmail.com>

Use push_had_errors() to check the refs for errors and modify the
return value.

Mark the non-fast-forward push tests to succeed.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---

Changed nothing from v2 except tests and mentioning it in the commit
message.

 t/t5541-http-push.sh |    4 ++--
 transport.c          |    7 +++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index 86dbcb2..fee9494 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -88,7 +88,7 @@ test_expect_success 'used receive-pack service' '
 	test_cmp exp act
 '

-test_expect_failure 'non-fast-forward push fails' '
+test_expect_success 'non-fast-forward push fails' '
 	cd "$ROOT_PATH"/test_repo_clone &&
 	git checkout master &&
 	echo "changed" > path2 &&
@@ -104,7 +104,7 @@ test_expect_success 'non-fast-forward push show ref status' '
 	grep "^ ! \[rejected\][ ]*master -> master (non-fast-forward)$" output
 '

-test_expect_failure 'non-fast-forward push shows help message' '
+test_expect_success 'non-fast-forward push shows help message' '
 	grep \
 "To prevent you from losing history, non-fast-forward updates were rejected
 Merge the remote changes before pushing again.  See the '"'non-fast-forward'"'
diff --git a/transport.c b/transport.c
index 12c4423..9b23989 100644
--- a/transport.c
+++ b/transport.c
@@ -875,7 +875,7 @@ int transport_push(struct transport *transport,
 		int verbose = flags & TRANSPORT_PUSH_VERBOSE;
 		int quiet = flags & TRANSPORT_PUSH_QUIET;
 		int porcelain = flags & TRANSPORT_PUSH_PORCELAIN;
-		int ret;
+		int ret, err;

 		if (flags & TRANSPORT_PUSH_ALL)
 			match_flags |= MATCH_REFS_ALL;
@@ -892,8 +892,11 @@ int transport_push(struct transport *transport,
 			flags & TRANSPORT_PUSH_FORCE);

 		ret = transport->push_refs(transport, remote_refs, flags);
+		err = push_had_errors(remote_refs);

-		if (!quiet || push_had_errors(remote_refs))
+		ret |= err;
+
+		if (!quiet || err)
 			print_push_status(transport->url, remote_refs,
 					verbose | porcelain, porcelain,
 					nonfastforward);
--
1.6.6.rc1.249.g048b3

^ permalink raw reply related

* [PATCH v3 3/6] refactor ref status logic for pushing
From: Tay Ray Chuan @ 2009-12-24  7:42 UTC (permalink / raw)
  To: git; +Cc: Shawn O. Pearce, Daniel Barkalow, Jeff King, Junio C Hamano
In-Reply-To: <20091224154158.15ba580f.rctay89@gmail.com>

Move the logic that detects up-to-date and non-fast-forward refs to a
new function in remote.[ch], set_ref_status_for_push().

Make transport_push() invoke set_ref_status_for_push() before invoking
the push_refs() implementation. (As a side-effect, the push_refs()
implementation in transport-helper.c now knows of non-fast-forward
pushes.)

Removed logic for detecting up-to-date refs from the push_refs()
implementation in transport-helper.c, as transport_push() has already
done so for it.

Make cmd_send_pack() invoke set_ref_status_for_push() before invoking
send_pack(), as transport_push() can't do it for send_pack() here.

Mark the test on the return status of non-fast-forward push to fail.
Git now exits with success, as transport.c::transport_push() does not
check for refs with status REF_STATUS_REJECT_NONFASTFORWARD nor does it
indicate rejected pushes with its return value.

Mark the test for ref status to succeed. As mentioned earlier, refs
might be marked as non-fast-forwards, triggering the push status
printing mechanism in transport.c.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---

Changed nothing from v2 except tests and mentioning it in the commit
message.

 builtin-send-pack.c  |   50 +++++++++++---------------------------------------
 remote.c             |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 remote.h             |    2 ++
 t/t5541-http-push.sh |    4 ++--
 transport-helper.c   |   13 ++++++-------
 transport.c          |    4 ++++
 6 files changed, 75 insertions(+), 48 deletions(-)

diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index 8fffdbf..38580c3 100644
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
@@ -406,50 +406,19 @@ int send_pack(struct send_pack_args *args,
 	 */
 	new_refs = 0;
 	for (ref = remote_refs; ref; ref = ref->next) {
-
-		if (ref->peer_ref)
-			hashcpy(ref->new_sha1, ref->peer_ref->new_sha1);
-		else if (!args->send_mirror)
+		if (!ref->peer_ref && !args->send_mirror)
 			continue;

-		ref->deletion = is_null_sha1(ref->new_sha1);
-		if (ref->deletion && !allow_deleting_refs) {
-			ref->status = REF_STATUS_REJECT_NODELETE;
-			continue;
-		}
-		if (!ref->deletion &&
-		    !hashcmp(ref->old_sha1, ref->new_sha1)) {
-			ref->status = REF_STATUS_UPTODATE;
+		switch (ref->status) {
+		case REF_STATUS_REJECT_NONFASTFORWARD:
+		case REF_STATUS_UPTODATE:
 			continue;
+		default:
+			; /* do nothing */
 		}

-		/* This part determines what can overwrite what.
-		 * The rules are:
-		 *
-		 * (0) you can always use --force or +A:B notation to
-		 *     selectively force individual ref pairs.
-		 *
-		 * (1) if the old thing does not exist, it is OK.
-		 *
-		 * (2) if you do not have the old thing, you are not allowed
-		 *     to overwrite it; you would not know what you are losing
-		 *     otherwise.
-		 *
-		 * (3) if both new and old are commit-ish, and new is a
-		 *     descendant of old, it is OK.
-		 *
-		 * (4) regardless of all of the above, removing :B is
-		 *     always allowed.
-		 */
-
-		ref->nonfastforward =
-		    !ref->deletion &&
-		    !is_null_sha1(ref->old_sha1) &&
-		    (!has_sha1_file(ref->old_sha1)
-		      || !ref_newer(ref->new_sha1, ref->old_sha1));
-
-		if (ref->nonfastforward && !ref->force && !args->force_update) {
-			ref->status = REF_STATUS_REJECT_NONFASTFORWARD;
+		if (ref->deletion && !allow_deleting_refs) {
+			ref->status = REF_STATUS_REJECT_NODELETE;
 			continue;
 		}

@@ -673,6 +642,9 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
 	if (match_refs(local_refs, &remote_refs, nr_refspecs, refspecs, flags))
 		return -1;

+	set_ref_status_for_push(remote_refs, args.send_mirror,
+		args.force_update);
+
 	ret = send_pack(&args, fd, conn, remote_refs, &extra_have);

 	if (helper_status)
diff --git a/remote.c b/remote.c
index e3afecd..c70181c 100644
--- a/remote.c
+++ b/remote.c
@@ -1247,6 +1247,56 @@ int match_refs(struct ref *src, struct ref **dst,
 	return 0;
 }

+void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
+	int force_update)
+{
+	struct ref *ref;
+
+	for (ref = remote_refs; ref; ref = ref->next) {
+		if (ref->peer_ref)
+			hashcpy(ref->new_sha1, ref->peer_ref->new_sha1);
+		else if (!send_mirror)
+			continue;
+
+		ref->deletion = is_null_sha1(ref->new_sha1);
+		if (!ref->deletion &&
+			!hashcmp(ref->old_sha1, ref->new_sha1)) {
+			ref->status = REF_STATUS_UPTODATE;
+			continue;
+		}
+
+		/* This part determines what can overwrite what.
+		 * The rules are:
+		 *
+		 * (0) you can always use --force or +A:B notation to
+		 *     selectively force individual ref pairs.
+		 *
+		 * (1) if the old thing does not exist, it is OK.
+		 *
+		 * (2) if you do not have the old thing, you are not allowed
+		 *     to overwrite it; you would not know what you are losing
+		 *     otherwise.
+		 *
+		 * (3) if both new and old are commit-ish, and new is a
+		 *     descendant of old, it is OK.
+		 *
+		 * (4) regardless of all of the above, removing :B is
+		 *     always allowed.
+		 */
+
+		ref->nonfastforward =
+			!ref->deletion &&
+			!is_null_sha1(ref->old_sha1) &&
+			(!has_sha1_file(ref->old_sha1)
+			  || !ref_newer(ref->new_sha1, ref->old_sha1));
+
+		if (ref->nonfastforward && !ref->force && !force_update) {
+			ref->status = REF_STATUS_REJECT_NONFASTFORWARD;
+			continue;
+		}
+	}
+}
+
 struct branch *branch_get(const char *name)
 {
 	struct branch *ret;
diff --git a/remote.h b/remote.h
index 8b7ecf9..6e13643 100644
--- a/remote.h
+++ b/remote.h
@@ -98,6 +98,8 @@ char *apply_refspecs(struct refspec *refspecs, int nr_refspec,

 int match_refs(struct ref *src, struct ref **dst,
 	       int nr_refspec, const char **refspec, int all);
+void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
+	int force_update);

 /*
  * Given a list of the remote refs and the specification of things to
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index 5ebe04a..86dbcb2 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -88,7 +88,7 @@ test_expect_success 'used receive-pack service' '
 	test_cmp exp act
 '

-test_expect_success 'non-fast-forward push fails' '
+test_expect_failure 'non-fast-forward push fails' '
 	cd "$ROOT_PATH"/test_repo_clone &&
 	git checkout master &&
 	echo "changed" > path2 &&
@@ -100,7 +100,7 @@ test_expect_success 'non-fast-forward push fails' '
 	 test $HEAD != $(git rev-parse --verify HEAD))
 '

-test_expect_failure 'non-fast-forward push show ref status' '
+test_expect_success 'non-fast-forward push show ref status' '
 	grep "^ ! \[rejected\][ ]*master -> master (non-fast-forward)$" output
 '

diff --git a/transport-helper.c b/transport-helper.c
index 11f3d7e..6b1f778 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -329,16 +329,15 @@ static int push_refs(struct transport *transport,
 		return 1;

 	for (ref = remote_refs; ref; ref = ref->next) {
-		if (ref->peer_ref)
-			hashcpy(ref->new_sha1, ref->peer_ref->new_sha1);
-		else if (!mirror)
+		if (!ref->peer_ref && !mirror)
 			continue;

-		ref->deletion = is_null_sha1(ref->new_sha1);
-		if (!ref->deletion &&
-			!hashcmp(ref->old_sha1, ref->new_sha1)) {
-			ref->status = REF_STATUS_UPTODATE;
+		switch (ref->status) {
+		case REF_STATUS_REJECT_NONFASTFORWARD:
+		case REF_STATUS_UPTODATE:
 			continue;
+		default:
+			; /* do nothing */
 		}

 		if (force_all)
diff --git a/transport.c b/transport.c
index 3eea836..12c4423 100644
--- a/transport.c
+++ b/transport.c
@@ -887,6 +887,10 @@ int transport_push(struct transport *transport,
 			return -1;
 		}

+		set_ref_status_for_push(remote_refs,
+			flags & TRANSPORT_PUSH_MIRROR,
+			flags & TRANSPORT_PUSH_FORCE);
+
 		ret = transport->push_refs(transport, remote_refs, flags);

 		if (!quiet || push_had_errors(remote_refs))
--
1.6.6.rc1.249.g048b3

^ permalink raw reply related

* [PATCH v3 2/6] t5541-http-push.sh: add test for unmatched, non-fast-forwarded refs
From: Tay Ray Chuan @ 2009-12-24  7:41 UTC (permalink / raw)
  To: git; +Cc: Shawn O. Pearce, Daniel Barkalow, Jeff King, Junio C Hamano
In-Reply-To: <20091224154057.33611ae7.rctay89@gmail.com>

Test that when non-fast-forwarded refs cannot be matched without an
explicit refspect, the push fails with a non-fast-forward ref status and
help message.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 t/t5541-http-push.sh |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index f49c7c4..5ebe04a 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -111,5 +111,25 @@ Merge the remote changes before pushing again.  See the '"'non-fast-forward'"'
 section of '"'git push --help'"' for details." output
 '

+test_expect_failure 'push fails for non-fast-forward refs unmatched by remote helper' '
+	# create a dissimilarly-named ref so that git is unable to match the refs
+	git push origin master:retsam
+
+	echo "change changed" > path2 &&
+	git commit -a -m path2 --amend &&
+
+	# push master too. This ensures there is at least one '"'push'"' command to
+	# the remote helper and triggers interaction with the helper.
+	!(git push -v origin +master master:retsam >output 2>&1) &&
+
+	grep "^ + [a-z0-9]\+\.\.\.[a-z0-9]\+[ ]*master -> master (forced update)$" output &&
+	grep "^ ! \[rejected\][ ]*master -> retsam (non-fast-forward)$" output &&
+
+	grep \
+"To prevent you from losing history, non-fast-forward updates were rejected
+Merge the remote changes before pushing again.  See the '"'non-fast-forward'"'
+section of '"'git push --help'"' for details." output
+'
+
 stop_httpd
 test_done
--
1.6.6.rc1.249.g048b3

^ permalink raw reply related

* [PATCH v3 0/6] transport: catch non-fast forwards
From: Tay Ray Chuan @ 2009-12-24  7:40 UTC (permalink / raw)
  To: git; +Cc: Shawn O. Pearce, Daniel Barkalow, Jeff King, Junio C Hamano
In-Reply-To: <20091208223413.98e99d3e.rctay89@gmail.com>

Junio, this is re-roll of the 'tr/http-push-ref-status' branch in 'pu'.

Summary:
  This patch series applies on top of 'next', and deals with alerting
  the user to rejected non-fast-forward pushes when using helpers
  (smart).

  Previously, git silently exited. This situation involves the curl
  helper and the smart protocol. The non-fast-forward push is only
  detected when curl executes the rpc client (git-send-pack). Now, we
  detect it before telling the helper to push.

Changes from v2:
 - add tests
 - modify commit messages to mention tests
 - report rejected non-fast-forward pushes for unmatched refs
   (without an explicit refspec) by the remote helper (see patches #2
   and #5).

   This remedies the scenario where a user would not be aware of
   rejected non-fast-forward pushes.

   It occurs when
     1) there are one or more pushes that succeed and
     2) there are one or more rejected non-fast-forward pushes that
	    involve refs that cannot be matched without explicit refspecs.

   This is due to the re-marking of ref status in transport-helper.c::
   push_refs() when interacting with the remote helper.

   If only non-matched, non-fast-forward refs are involved (ie.
   condition #2 is present without #1), then the situtation does not
   occur - no 'push' commands are passed to the remote helper, no
   interaction with the helper takes place, and no re-marking of ref
   status takes place. The user will be alerted to the rejected
   non-fast-forward push.

   If both are present, re-marking occurs. Even if a ref was not part
   of a 'push' command to the helper, 'ok'/'error' status reports might
   be made for it, since the remote helper does ref matching on its
   side. This led to refs that cannot be matched without an explicit
   refspec marked as REF_STATUS_REJECT_NONFASTFORWARD to be re-marked
   REF_STATUS_NONE.

   (Note: helpers fail to match refs as explicit refspecs are always
   available to the top-level transport mechanism, but only on a need-
   to-know basis to the remote helper via a 'push' command when a ref
   is to be pushed.)

   Interestingly, it is possible for a user to be forever unaware of
   the rejected push if the user relies on information from git push
   alone. As long as the user ensures that one or more other pushes are
   successful (eg. change a tracked ref fast-forwardedly) between the
   execution of git push, the rejected non-fast-forward push won't be
   reported.

Tay Ray Chuan (6):
  t5541-http-push.sh: add tests for non-fast-forward pushes
  t5541-http-push.sh: add test for unmatched, non-fast-forwarded refs
  refactor ref status logic for pushing
  transport.c::transport_push(): make ref status affect return value
  transport-helper.c::push_refs(): ignore helper-reported status if ref
    is not to be pushed
  transport-helper.c::push_refs(): emit "no refs" error message

 builtin-send-pack.c  |   50 +++++++++++---------------------------------------
 remote.c             |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 remote.h             |    2 ++
 t/t5541-http-push.sh |   43 +++++++++++++++++++++++++++++++++++++++++++
 transport-helper.c   |   32 ++++++++++++++++++++++----------
 transport.c          |   11 +++++++++--
 6 files changed, 137 insertions(+), 51 deletions(-)

--
Cheers,
Ray Chuan

^ permalink raw reply

* Re: Specifying excludesfile in a portable way?
From: Jeff King @ 2009-12-24  7:36 UTC (permalink / raw)
  To: Fyn Fynn; +Cc: git
In-Reply-To: <1a04eebf0912232314y5dcbdfa7w4adea2eb617e0992@mail.gmail.com>

On Wed, Dec 23, 2009 at 11:14:10PM -0800, Fyn Fynn wrote:

> On Wed, Dec 23, 2009 at 9:53 PM, Jeff King <peff@peff.net> wrote:
> > Not in v1.6.4, but you can use "~/.gitexcludes" in v1.6.6 (which was
> > just released today).
> 
> That's great to hear!  But since it can take some time to update git
> on all machines, is there an alternative for now, e.g. a way to
> specify all those exclusions in .gitconfig itself?

No, I don't think there is another way to specify excludes in the config
file directly.

-Peff

^ permalink raw reply

* Re: Specifying excludesfile in a portable way?
From: Fyn Fynn @ 2009-12-24  7:14 UTC (permalink / raw)
  To: Jeff King; +Cc: git
In-Reply-To: <20091224055350.GB419@sigill.intra.peff.net>

On Wed, Dec 23, 2009 at 9:53 PM, Jeff King <peff@peff.net> wrote:
> Not in v1.6.4, but you can use "~/.gitexcludes" in v1.6.6 (which was
> just released today).

That's great to hear!  But since it can take some time to update git
on all machines, is there an alternative for now, e.g. a way to
specify all those exclusions in .gitconfig itself?

> -Peff
>

^ permalink raw reply

* Re: Specifying excludesfile in a portable way?
From: Jeff King @ 2009-12-24  5:53 UTC (permalink / raw)
  To: Fyn Fynn; +Cc: git
In-Reply-To: <1a04eebf0912231945l3235bc4dpdd8c541feef9bdd3@mail.gmail.com>

On Wed, Dec 23, 2009 at 07:45:14PM -0800, Fyn Fynn wrote:

> Is there a way to specify that in a portable way?  I tried both
> ~/.gitexcludes and $HOME/.gitexcludes; neither worked on any platform.
> 
> git version on both platforms is 1.6.4

Not in v1.6.4, but you can use "~/.gitexcludes" in v1.6.6 (which was
just released today).

-Peff

^ permalink raw reply

* Re: git tag --contains <commit> -n=1 ?
From: Jeff King @ 2009-12-24  5:52 UTC (permalink / raw)
  To: NODA, Kai; +Cc: git
In-Reply-To: <4B327F8F.2060106@gmail.com>

On Thu, Dec 24, 2009 at 05:37:35AM +0900, NODA, Kai wrote:

> >Since the output of git tag is sorted by name, generally not.
> 
> Wow, I didn't know that.
> But then, under the assumption that tags have names like verNNN,
> that behavior ensures me that "head -1" works as intended.

If that assumption does not hold, you can also sort by date. See:

  http://article.gmane.org/gmane.comp.version-control.git/133586

-Peff

^ permalink raw reply

* Specifying excludesfile in a portable way?
From: Fyn Fynn @ 2009-12-24  3:45 UTC (permalink / raw)
  To: git

I have specify an excludesfile in my ~/.gitconfig:

  [core]
      excludesfile = /Users/fynn/.gitexcludes

This works fine for my OS X workstation. But when I sync this
.gitconfig to our Linux server, the excludesfile is ignored because my
home directory there is /home/fynn.

Is there a way to specify that in a portable way?  I tried both
~/.gitexcludes and $HOME/.gitexcludes; neither worked on any platform.

git version on both platforms is 1.6.4

Thanks,
Fynn

^ permalink raw reply

* [ANNOUNCE] Git 1.6.6
From: Junio C Hamano @ 2009-12-24  1:06 UTC (permalink / raw)
  To: git

The latest feature release Git 1.6.6 is available at the usual
places:

  http://www.kernel.org/pub/software/scm/git/

  git-1.6.6.tar.{gz,bz2}			(source tarball)
  git-htmldocs-1.6.6.tar.{gz,bz2}		(preformatted docs)
  git-manpages-1.6.6.tar.{gz,bz2}		(preformatted docs)

The RPM binary packages for a few architectures are found in:

  RPMS/$arch/git-*-1.6.6-1.fc11.$arch.rpm	(RPM)

Git v1.6.6 Release Notes
========================

Notes on behaviour change
-------------------------

 * In this release, "git fsck" defaults to "git fsck --full" and
   checks packfiles, and because of this it will take much longer to
   complete than before.  If you prefer a quicker check only on loose
   objects (the old default), you can say "git fsck --no-full".  This
   has been supported by 1.5.4 and newer versions of git, so it is
   safe to write it in your script even if you use slightly older git
   on some of your machines.

Preparing yourselves for compatibility issues in 1.7.0
------------------------------------------------------

In git 1.7.0, which is planned to be the release after 1.6.6, there will
be a handful of behaviour changes that will break backward compatibility.

These changes were discussed long time ago and existing behaviours have
been identified as more problematic to the userbase than keeping them for
the sake of backward compatibility.

When necessary, a transition strategy for existing users has been designed
not to force them running around setting configuration variables and
updating their scripts in order to either keep the traditional behaviour
or adjust to the new behaviour, on the day their sysadmin decides to install
the new version of git.  When we switched from "git-foo" to "git foo" in
1.6.0, even though the change had been advertised and the transition
guide had been provided for a very long time, the users procrastinated
during the entire transtion period, and ended up panicking on the day
their sysadmins updated their git installation.  We are trying to avoid
repeating that unpleasantness in the 1.7.0 release.

For changes decided to be in 1.7.0, commands that will be affected
have been much louder to strongly discourage such procrastination, and
they continue to be in this release.  If you have been using recent
versions of git, you would have seen warnings issued when you used
features whose behaviour will change, with a clear instruction on how
to keep the existing behaviour if you want to.  You hopefully are
already well prepared.

Of course, we have also been giving "this and that will change in
1.7.0; prepare yourselves" warnings in the release notes and
announcement messages for the past few releases.  Let's see how well
users will fare this time.

 * "git push" into a branch that is currently checked out (i.e. pointed by
   HEAD in a repository that is not bare) will be refused by default.

   Similarly, "git push $there :$killed" to delete the branch $killed
   in a remote repository $there, when $killed branch is the current
   branch pointed at by its HEAD, will be refused by default.

   Setting the configuration variables receive.denyCurrentBranch and
   receive.denyDeleteCurrent to 'ignore' in the receiving repository
   can be used to override these safety features.  Versions of git
   since 1.6.2 have issued a loud warning when you tried to do these
   operations without setting the configuration, so repositories of
   people who still need to be able to perform such a push should
   already have been future proofed.

   Please refer to:

   http://git.or.cz/gitwiki/GitFaq#non-bare
   http://thread.gmane.org/gmane.comp.version-control.git/107758/focus=108007

   for more details on the reason why this change is needed and the
   transition process that already took place so far.

 * "git send-email" will not make deep threads by default when sending a
   patch series with more than two messages.  All messages will be sent
   as a reply to the first message, i.e. cover letter.  Git 1.6.6 (this
   release) will issue a warning about the upcoming default change, when
   it uses the traditional "deep threading" behaviour as the built-in
   default.  To squelch the warning but still use the "deep threading"
   behaviour, give --chain-reply-to option or set sendemail.chainreplyto
   to true.

   It has been possible to configure send-email to send "shallow thread"
   by setting sendemail.chainreplyto configuration variable to false.
   The only thing 1.7.0 release will do is to change the default when
   you haven't configured that variable.

 * "git status" will not be "git commit --dry-run".  This change does not
   affect you if you run the command without pathspec.

   Nobody sane found the current behaviour of "git status Makefile" useful
   nor meaningful, and it confused users.  "git commit --dry-run" has been
   provided as a way to get the current behaviour of this command since
   1.6.5.

 * "git diff" traditionally treated various "ignore whitespace" options
   only as a way to filter the patch output.  "git diff --exit-code -b"
   exited with non-zero status even if all changes were about changing the
   ammount of whitespace and nothing else.  and "git diff -b" showed the
   "diff --git" header line for such a change without patch text.

   In 1.7.0, the "ignore whitespaces" will affect the semantics of the
   diff operation itself.  A change that does not affect anything but
   whitespaces will be reported with zero exit status when run with
   --exit-code, and there will not be "diff --git" header for such a
   change.


Updates since v1.6.5
--------------------

(subsystems)

 * various gitk updates including use of themed widgets under Tk 8.5,
   Japanese translation, a fix to a bug when running "gui blame" from
   a subdirectory, etc.

 * various git-gui updates including new translations, wm states fixes,
   Tk bug workaround after quitting, improved heuristics to trigger gc,
   etc.

 * various git-svn updates.

 * "git fetch" over http learned a new mode that is different from the
   traditional "dumb commit walker".

(portability)

 * imap-send can be built on mingw port.

(performance)

 * "git diff -B" has smaller memory footprint.

(usability, bells and whistles)

 * The object replace mechanism can be bypassed with --no-replace-objects
   global option given to the "git" program.

 * In configuration files, a few variables that name paths can begin with ~/
   and ~username/ and they are expanded as expected.

 * "git subcmd -h" now shows short usage help for many more subcommands.

 * "git bisect reset" can reset to an arbitrary commit.

 * "git checkout frotz" when there is no local branch "frotz" but there
   is only one remote tracking branch "frotz" is taken as a request to
   start the named branch at the corresponding remote tracking branch.

 * "git commit -c/-C/--amend" can be told with a new "--reset-author" option
   to ignore authorship information in the commit it is taking the message
   from.

 * "git describe" can be told to add "-dirty" suffix with "--dirty" option.

 * "git diff" learned --submodule option to show a list of one-line logs
   instead of differences between the commit object names.

 * "git diff" learned to honor diff.color.func configuration to paint
   function name hint printed on the hunk header "@@ -j,k +l,m @@" line
   in the specified color.

 * "git fetch" learned --all and --multiple options, to run fetch from
   many repositories, and --prune option to remove remote tracking
   branches that went stale.  These make "git remote update" and "git
   remote prune" less necessary (there is no plan to remove "remote
   update" nor "remote prune", though).

 * "git fsck" by default checks the packfiles (i.e. "--full" is the
   default); you can turn it off with "git fsck --no-full".

 * "git grep" can use -F (fixed strings) and -i (ignore case) together.

 * import-tars contributed fast-import frontend learned more types of
   compressed tarballs.

 * "git instaweb" knows how to talk with mod_cgid to apache2.

 * "git log --decorate" shows the location of HEAD as well.

 * "git log" and "git rev-list" learned to take revs and pathspecs from
   the standard input with the new "--stdin" option.

 * "--pretty=format" option to "log" family of commands learned:

   . to wrap text with the "%w()" specifier.
   . to show reflog information with "%g[sdD]" specifier.

 * "git notes" command to annotate existing commits.

 * "git merge" (and "git pull") learned --ff-only option to make it fail
   if the merge does not result in a fast-forward.

 * "git mergetool" learned to use p4merge.

 * "git rebase -i" learned "reword" that acts like "edit" but immediately
   starts an editor to tweak the log message without returning control to
   the shell, which is done by "edit" to give an opportunity to tweak the
   contents.

 * "git send-email" can be told with "--envelope-sender=auto" to use the
   same address as "From:" address as the envelope sender address.

 * "git send-email" will issue a warning when it defaults to the
   --chain-reply-to behaviour without being told by the user and
   instructs to prepare for the change of the default in 1.7.0 release.

 * In "git submodule add <repository> <path>", <path> is now optional and
   inferred from <repository> the same way "git clone <repository>" does.

 * "git svn" learned to read SVN 1.5+ and SVK merge tickets.

 * "git svn" learned to recreate empty directories tracked only by SVN.

 * "gitweb" can optionally render its "blame" output incrementally (this
   requires JavaScript on the client side).

 * Author names shown in gitweb output are links to search commits by the
   author.

Fixes since v1.6.5
------------------

All of the fixes in v1.6.5.X maintenance series are included in this
release, unless otherwise noted.


----------------------------------------------------------------

Changes since v1.6.5 are as follows:

Alex Riesen (1):
      git-gui: Update russian translation

Alex Vandiver (3):
      git-svn: sort svk merge tickets to account for minimal parents
      git-svn: Set svn.authorsfile to an absolute path when cloning
      git-svn: set svn.authorsfile earlier when cloning

Alexander Gavrilov (1):
      git-gui: Increase blame viewer usability on MacOS.

Alexey Borzenkov (1):
      git-gui: store wm state and fix wm geometry

Anders Kaseorg (1):
      bisect reset: Allow resetting to any commit, not just a branch

Andreas Schwab (1):
      Work around option parsing bug in the busybox tar implementation

Andrew Myrick (1):
      git-svn: Remove obsolete MAXPARENT check

Avery Pennarun (1):
      builtin-merge.c: call exclude_cmds() correctly.

Ben Walton (2):
      configure: add macro to set arbitrary make variables
      configure: add settings for gitconfig, editor and pager

Benjamin Kramer (1):
      Explicitly truncate bswap operand to uint32_t

Bernt Hansen (1):
      gitk: Skip translation of "wrong Tcl version" message

Bert Wesarg (2):
      Give the hunk comment its own color
      get_ref_states: strdup entries and free util in stale list

Björn Gustavsson (24):
      Teach 'rebase -i' the command "reword"
      git-clone.txt: Fix grammar and formatting
      bash: complete more options for 'git rebase'
      Teach 'git merge' and 'git pull' the option --ff-only
      Teach the --all option to 'git fetch'
      Teach the --multiple option to 'git fetch'
      Add the configuration option skipFetchAll
      Add missing test for 'git remote update --prune'
      Re-implement 'git remote update' using 'git fetch'
      format-patch: Always generate a patch
      format-patch documentation: Remove diff options that are not useful
      format-patch documentation: Fix formatting
      format-patch: Add "--no-stat" as a synonym for "-p"
      bash: add the merge option --ff-only
      Clarify and correct -z
      apply: apply works outside a repository
      apply: Format all options using back-quotes
      apply: Use the term "working tree" consistently
      Fix truncated usage messages
      User Manual: Write "Git" instead of "GIT"
      Fix over-simplified documentation for 'git log -z'
      gitworkflows: Consistently back-quote git commands
      bash: Support new 'git fetch' options
      rebase -i: abort cleanly if the editor fails to launch

Björn Steinbrink (2):
      clone: Supply the right commit hash to post-checkout when -b is used
      pre-commit.sample: Diff against the empty tree when HEAD is invalid

Brandon Casey (2):
      t4201: use ISO8859-1 rather than ISO-8859-1
      t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'

Brian Collins (1):
      grep: Allow case insensitive search of fixed-strings

Brian Gernhardt (1):
      t/gitweb-lib: Split HTTP response with non-GNU sed

Carlos R. Mafra (1):
      Makefile: clean block-sha1/ directory instead of mozilla-sha1/

Christian Couder (7):
      git: add --no-replace-objects option to disable replacing
      Documentation: add "Fighting regressions with git bisect" article
      replace: use a GIT_NO_REPLACE_OBJECTS env variable
      Documentation: fix typos and spelling in replace documentation
      Documentation: talk a little bit about GIT_NO_REPLACE_OBJECTS
      bisect: simplify calling visualizer using '--bisect' option
      Documentation: update descriptions of revision options related to '--bisect'

Clemens Buchacher (4):
      modernize fetch/merge/pull examples
      remote-helpers: return successfully if everything up-to-date
      set httpd port before sourcing lib-httpd
      git-gui: search 4 directories to improve statistic of gc hint

Dan Zwell (1):
      git-gui: Limit display to a maximum number of files

Daniel Barkalow (2):
      Require a struct remote in transport_get()
      Allow curl helper to work without a local repository

David Aguilar (2):
      submodule.c: Squelch a "use before assignment" warning
      help: Do not unnecessarily look for a repository

David Brown (1):
      commit: More generous accepting of RFC-2822 footer lines.

David Kågedal (1):
      git-blame.el: Change how blame information is shown.

David Reiss (1):
      Prevent git blame from segfaulting on a missing author name

David Soria Parra (1):
      Documentation: Document --branch option in git clone synopsis

Dmitry V. Levin (1):
      Makefile: add compat/bswap.h to LIB_H

Eric Wong (13):
      git svn: fix fetch where glob is on the top-level URL
      git svn: read global+system config for clone+init
      git svn: add authorsfile test case for ~/.gitconfig
      git svn: attempt to create empty dirs on clone+rebase
      git svn: always reuse existing remotes on fetch
      git svn: strip leading path when making empty dirs
      git svn: log removals of empty directories
      git svn: make empty directory creation gc-aware
      t9146: use 'svn_cmd' wrapper
      git svn: fix --revision when fetching deleted paths
      update release notes for git svn in 1.6.6
      git svn: lookup new parents correctly from svn:mergeinfo
      git svn: branch/tag commands detect username in URLs

Erick Mattos (1):
      commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author

Erik Faye-Lund (6):
      imap-send: use separate read and write fds
      imap-send: use run-command API for tunneling
      imap-send: fix compilation-error on Windows
      imap-send: build imap-send on Windows
      mingw: wrap SSL_set_(w|r)fd to call _get_osfhandle
      mingw: enable OpenSSL

Felipe Contreras (5):
      diff.c: stylefix
      Use 'fast-forward' all over the place
      format-patch: fix parsing of "--" on the command line
      format-patch: add test for parsing of "--"
      send-email: automatic envelope sender

Gerrit Pape (1):
      help -i: properly error out if no info viewer can be found

Gisle Aas (2):
      More precise description of 'git describe --abbrev'
      Fix documentation grammar typo

Giuseppe Bilotta (1):
      gitweb: fix esc_param

Greg Price (2):
      Documentation: undocument gc'd function graph_release()
      git svn: Don't create empty directories whose parents were deleted

Guillermo S. Romero (1):
      gitk: Add configuration for UI colour scheme

Heiko Voigt (2):
      git-gui: remove warning when deleting correctly merged remote branch
      git gui: make current branch default in "remote delete branch" merge check

Horst H. von Brand (1):
      git-pull.sh: Fix call to git-merge for new command format

Ingmar Vanhassel (1):
      import-tars: Add support for tarballs compressed with lzma, xz

Jakub Narebski (16):
      gitweb: Add optional "time to generate page" info in footer
      gitweb: Incremental blame (using JavaScript)
      gitweb: Colorize 'blame_incremental' view during processing
      gitweb: Create links leading to 'blame_incremental' using JavaScript
      gitweb: Minify gitweb.js if JSMIN is defined
      gitweb: Add 'show-sizes' feature to show blob sizes in tree view
      gitweb: Do not show 'patch' link for merge commits
      t/gitweb-lib.sh: Split gitweb output into headers and body
      gitweb: Document current snapshot rules via new tests
      gitweb: Refactor 'log' action generation, adding git_log_body()
      gitweb: Refactor common parts of 'log' and 'shortlog' views
      gitweb: Make 'history' view (re)use git_log_generic()
      gitweb.js: Harden setting blamed commit info in incremental blame
      gitweb: Make linking to actions requiring JavaScript a feature
      gitweb: Add link to other blame implementation in blame views
      gitweb: Describe (possible) gitweb.js minification in gitweb/README

Jan Krüger (2):
      rebase -i: more graceful handling of invalid commands
      pull: clarify advice for the unconfigured error case

Jari Aalto (3):
      Documentation/fetch-options.txt: order options alphabetically
      Documentation/git-pull.txt: Add subtitles above included option files
      Documentation/merge-options.txt: order options in alphabetical groups

Jay Soffian (4):
      remote: refactor some logic into get_stale_heads()
      teach warn_dangling_symref to take a FILE argument
      builtin-fetch: add --prune option
      builtin-fetch: add --dry-run option

Jean Privat (1):
      Teach "git describe" --dirty option

Jeff King (18):
      ls-files: excludes should not impact tracked files
      document push's new quiet option
      cvsimport: fix relative argument filenames
      imap-send: remove useless uid code
      push: always load default config
      gitignore: root most patterns at the top-level directory
      add-interactive: handle deletion of empty files
      ls-files: unbreak "ls-files -i"
      t915{0,1}: use $TEST_DIRECTORY
      push: fix typo in usage
      format-patch: make "-p" suppress diffstat
      diffcore-break: free filespec data as we go
      diffcore-break: save cnt_data for other phases
      prune-packed: only show progress when stderr is a tty
      rerere: don't segfault on failure to open rr-cache
      reset: improve worktree safety valves
      add-interactive: fix deletion of non-empty files
      ignore unknown color configuration

Jens Lehmann (7):
      git-gui: display summary when showing diff of a submodule
      git-gui: fix diff for partially staged submodule changes
      git submodule add: make the <path> parameter optional
      git-gui: fix use of uninitialized variable
      add tests for git diff --submodule
      gitk: Fix diffing committed -> staged (typo in diffcmd)
      gitk: Use the --submodule option for displaying diffs when available

Jimmy Angelakos (1):
      git-gui: Added Greek translation & glossary

Jindrich Makovicka (1):
      git-gui: suppress RenderBadPicture X error caused by Tk bug

Joe Perches (1):
      git-send-email.perl: fold multiple entry "Cc:" and multiple single line "RCPT TO:"s

Johan Herland (10):
      Teach "-m <msg>" and "-F <file>" to "git notes edit"
      fast-import: Add support for importing commit notes
      t3302-notes-index-expensive: Speed up create_repo()
      Add flags to get_commit_notes() to control the format of the note string
      Teach notes code to free its internal data structures on request
      Teach the notes lookup code to parse notes trees with various fanout schemes
      Add selftests verifying that we can parse notes trees with various fanouts
      Refactor notes code to concatenate multiple notes annotating the same object
      Add selftests verifying concatenation of multiple notes for the same commit
      Fix crasher on encountering SHA1-like non-note in notes tree

Johannes Schindelin (11):
      print_wrapped_text(): allow hard newlines
      Add strbuf_add_wrapped_text() to utf8.[ch]
      Introduce commit notes
      Add a script to edit/inspect notes
      Speed up git notes lookup
      Add an expensive test for git-notes
      Add '%N'-format for pretty-printing commit notes
      Add the --submodule option to the diff option family
      blame: make sure that the last line ends in an LF
      help -a: do not unnecessarily look for a repository
      diff --color-words -U0: fix the location of hunk headers

Johannes Sixt (7):
      remote-curl: add missing initialization of argv0_path
      Remove a left-over file from t/t5100
      Mark files in t/t5100 as UTF-8
      Windows: use BLK_SHA1 again
      t4014-format-patch: do not assume 'test' is available as non-builtin
      Add a notice that only certain functions can print color escape codes
      help.autocorrect: do not run a command if the command given is junk

Jonathan Nieder (40):
      Add tests for git check-ref-format
      Documentation: describe check-ref-format --branch
      check-ref-format: simplify --print implementation
      clone: detect extra arguments
      Handle more shell metacharacters in editor names
      Add intermediate build products to .gitignore
      Retire fetch--tool helper to contrib/examples
      Show usage string for 'git grep -h'
      Show usage string for 'git cherry -h'
      Show usage string for 'git commit-tree -h'
      Show usage string for 'git merge-ours -h'
      Show usage string for 'git show-ref -h'
      check-ref-format: update usage string
      merge: do not setup worktree twice
      http-fetch: add missing initialization of argv0_path
      Show usage string for 'git check-ref-format -h'
      Show usage string for 'git fast-import -h'
      Show usage string for 'git get-tar-commit-id -h'
      Show usage string for 'git imap-send -h'
      Show usage string for 'git mailsplit -h'
      Show usage string for 'git merge-one-file -h'
      Show usage string for 'git rev-parse -h'
      Show usage string for 'git show-index -h'
      Show usage string for 'git unpack-file -h'
      Show usage string for 'git stripspace -h'
      Let 'git http-fetch -h' show usage outside any git repository
      Show usage string for 'git http-push -h'
      Let 'git <command> -h' show usage without a git dir
      Introduce usagef() that takes a printf-style format
      merge-{recursive,subtree}: use usagef() to print usage
      diff --no-index: make the usage string less scary
      Do not use VISUAL editor on dumb terminals
      Suppress warnings from "git var -l"
      Teach git var about GIT_EDITOR
      Teach git var about GIT_PAGER
      add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"
      am -i, git-svn: use "git var GIT_PAGER"
      Provide a build time default-editor setting
      Speed up bash completion loading
      Makefile: do not clean arm directory

Julian Phillips (4):
      fetch: Speed up fetch by rewriting find_non_local_tags
      remote: Make ref_remove_duplicates faster for large numbers of refs
      fetch: Speed up fetch of large numbers of refs
      remote: fix use-after-free error detected by glibc in ref_remove_duplicates

Junio C Hamano (86):
      mailinfo: -b option keeps [bracketed] strings that is not a [PATCH] marker
      apply --whitespace=fix: fix handling of blank lines at the eof
      apply --whitespace=fix: detect new blank lines at eof correctly
      apply.c: split check_whitespace() into two
      apply --whitespace=warn/error: diagnose blank at EOF
      apply --whitespace: warn blank but not necessarily empty lines at EOF
      diff.c: the builtin_diff() deals with only two-file comparison
      diff --whitespace=warn/error: obey blank-at-eof
      diff --whitespace=warn/error: fix blank-at-eof check
      diff --color: color blank-at-eof
      core.whitespace: split trailing-space into blank-at-{eol,eof}
      diff --whitespace: fix blank lines at end
      diff.c: shuffling code around
      diff.c: split emit_line() from the first char and the rest of the line
      diff.c: emit_add_line() takes only the rest of the line
      diff -B: colour whitespace errors
      Pretty-format: %[+-]x to tweak inter-item newlines
      diff-lib.c: fix misleading comments on oneway_diff()
      unpack-trees: typofix
      unpack_callback(): use unpack_failed() consistently
      git check-ref-format --print
      info/grafts: allow trailing whitespaces at the end of line
      GIT 1.6.5.1
      Start 1.6.6 cycle
      check_filename(): make verify_filename() callable without dying
      DWIM "git checkout frotz" to "git checkout -b frotz origin/frotz"
      format_commit_message(): fix function signature
      fsck: default to "git fsck --full"
      git checkout --no-guess
      gc --auto --quiet: make the notice a bit less verboase
      receive-pack: run "gc --auto --quiet" and optionally "update-server-info"
      Fix incorrect error check while reading deflated pack data
      Teach --wrap to only indent without wrapping
      Do not fail "describe --always" in a tag-less repository
      Fix list of released versions in the toc document
      GIT 1.6.5.2
      Update draft release notes to 1.6.6
      clone: fix help on options
      Revert "Don't create the $GIT_DIR/branches directory on init"
      diff --color-words: bit of clean-up
      t1200: further modernize test script style
      t1200: prepare for merging with Fast-forward bikeshedding
      builtin-commit.c: fix logic to omit empty line before existing footers
      git-describe.txt: formatting fix
      check-ref-format -h: it does not know the --print option yet
      Provide a build time default-pager setting
      Git 1.6.5.3
      Update draft release notes to 1.6.6
      read_revision_from_stdin(): use strbuf
      Teach --stdin option to "log" family
      setup_revisions(): do not call get_pathspec() too early
      Make --stdin option to "log" family read also pathspecs
      diffcore-rename: reduce memory footprint by freeing blob data early
      Documentation: avoid xmlto input error
      t9001: test --envelope-sender option of send-email
      Git v1.6.6-rc0
      Add trivial tests for --stdin option to log family
      Protect scripted Porcelains from GREP_OPTIONS insanity
      builtin-apply.c: pay attention to -p<n> when determining the name
      Remove dead code from "git am"
      emit_line(): don't emit an empty <SET><RESET> followed by a newline
      Update draft release notes to 1.6.6 before merging topics for -rc1
      git-merge: a deprecation notice of the ancient command line syntax
      Update draft release notes to 1.6.6 before -rc1
      Do not misidentify "git merge foo HEAD" as an old-style invocation
      merge: do not add standard message when message is given with -m option
      Prepare for 1.6.5.4
      Git 1.6.6-rc1
      Documentation/Makefile: allow man.base.url.for.relative.link to be set from Make
      Unconditionally set man.base.url.for.relative.links
      Git 1.6.5.4
      Documentation: xmlto 0.0.18 does not know --stringparam
      Prepare for 1.6.5.5
      Git 1.6.5.5
      Revert recent "git merge <msg> HEAD <commit>..." deprecation
      Update draft release notes to 1.6.6 before -rc2
      Git 1.6.6-rc2
      Remove post-upload-hook
      Fix archive format with -- on the command line
      Git 1.6.5.6
      Update Release Notes for 1.6.6 to remove old bugfixes
      worktree: don't segfault with an absolute pathspec without a work tree
      Git 1.6.5.7
      Git 1.6.6-rc3
      Git 1.6.6-rc4
      Git 1.6.6

Linus Torvalds (2):
      Add '--bisect' revision machinery argument
      Fix diff -B/--dirstat miscounting of newly added contents

Lukas Sandström (1):
      git am/mailinfo: Don't look at in-body headers when rebasing

Marius Storm-Olsen (1):
      MSVC: Enable OpenSSL, and translate -lcrypto

Mark Lodato (5):
      http-backend: add GIT_PROJECT_ROOT environment var
      http-backend: reword some documentation
      http-backend: use mod_alias instead of mod_rewrite
      http-backend: add example for gitweb on same URL
      http-backend: more explict LocationMatch

Mark Rada (3):
      gitweb: check given hash before trying to create snapshot
      instaweb: support mod_cgid for apache2
      gitweb: Smarter snapshot names

Markus Heidelberg (4):
      t7800-difftool: fix the effectless GIT_DIFFTOOL_PROMPT test
      bash completion: difftool accepts the same options as diff
      t4034-diff-words: add a test for word diff without context
      gitk: Fix "git gui blame" invocation when called from top-level directory

Martin Storsjö (3):
      Disable CURLOPT_NOBODY before enabling CURLOPT_PUT and CURLOPT_POST
      Refactor winsock initialization into a separate function
      Enable support for IPv6 on MinGW

Matt Kraai (2):
      grep: do not segfault when -f is used
      Documentation/git-gc.txt: change "references" to "reference"

Matthew Ogilvie (6):
      core.autocrlf documentation: mention the crlf attribute
      cvsserver doc: database generally can not be reproduced consistently
      config documentation: some configs are auto-set by git-init
      t2300: use documented technique to invoke git-sh-setup
      t3409 t4107 t7406 t9150: use dashless commands
      t/README: Document GIT_TEST_INSTALLED and GIT_TEST_EXEC_PATH

Matthieu Moy (6):
      Expand ~ and ~user in core.excludesfile, commit.template
      expand_user_path: expand ~ to $HOME, not to the actual homedir.
      merge-recursive: point the user to commit when file would be overwritten.
      user-manual: Document that "git merge" doesn't like uncommited changes.
      merge-recursive: make the error-message generation an extern function
      builtin-merge: show user-friendly error messages for fast-forward too.

Michael J Gruber (2):
      Make t9150 and t9151 test scripts executable
      Documentation: Fix a few i.e./e.g. mix-ups

Miklos Vajna (1):
      git-stash documentation: mention default options for 'list'

Mizar (2):
      gitk: Add Japanese translation
      gitk: Update Japanese translation

Nanako Shiraishi (5):
      git push: remove incomplete options list from help text
      git push: say that --tag can't be used with --all or --mirror in help text
      t1200: fix a timing dependent error
      prepare send-email for smoother change of --chain-reply-to default
      Illustrate "filter" attribute with an example

Nasser Grainawi (1):
      Document `delta` attribute in "git help attributes".

Nicolas Pitre (4):
      change throughput display units with fast links
      pack-objects: move thread autodetection closer to relevant code
      give priority to progress messages
      pack-objects: split implications of --all-progress from progress activation

Pat Thoyts (4):
      gitk: Use themed tk widgets
      gitk: Fix errors in the theme patch
      gitk: Default to the system colours on Windows
      gitk: Fix selection of tags

Paul Mackerras (5):
      gitk: Restore scrolling position of diff pane on back/forward in history
      gitk: Add a user preference to enable/disable use of themed widgets
      gitk: Show diff of commits at end of compare-commits output
      gitk: Don't compare fake children when comparing commits
      gitk: Improve appearance of radiobuttons and checkbuttons

Pauli Virtanen (1):
      git-add--interactive: never skip files included in index

Petr Baudis (1):
      gitweb: Fix blob linenr links in pathinfo mode

Philippe Bruhat (1):
      Make sure $PERL_PATH is defined when the test suite is run.

Raman Gupta (1):
      Add branch management for releases to gitworkflows

Ramsay Allan Jones (5):
      Makefile: merge two Cygwin configuration sections into one
      Makefile: keep MSVC and Cygwin configuration separate
      MSVC: Add support for building with NO_MMAP
      t9700-perl-git.sh: Fix a test failure on Cygwin
      git-count-objects: Fix a disk-space under-estimate on Cygwin

René Scharfe (9):
      describe: load refnames before calling describe()
      Implement wrap format %w() as if it is a mode switch
      log --format: don't ignore %w() at the start of format string
      grep: unset GREP_OPTIONS before spawning external grep
      strbuf_add_wrapped_text(): factor out strbuf_add_indented_text()
      log --format: document %w
      strbuf_add_wrapped_text(): skip over colour codes
      mergetool--lib: simplify guess_merge_tool()
      archive: clarify description of path parameter

Robert Zeh (1):
      git svn: add test for a git svn gc followed by a git svn mkdirs

Robin Rosenberg (1):
      Don't create the $GIT_DIR/branches directory on init

SZEDER Gábor (2):
      Documentation: add 'git replace' to main git manpage
      bash: update 'git commit' completion

Sam Vilain (10):
      git-svn: add test data for SVK merge, with script.
      git-svn: allow test setup script to support PERL env. var
      git-svn: convert SVK merge tickets to extra parents
      git-svn: add test data for SVN 1.5+ merge, with script.
      git-svn: convert SVN 1.5+ / svnmerge.py svn:mergeinfo props to parents
      git-svn: expand the svn mergeinfo test suite, highlighting some failures
      git-svn: memoize conversion of SVN merge ticket info to git commit ranges
      git-svn: fix some mistakes with interpreting SVN mergeinfo commit ranges
      git-svn: exclude already merged tips using one rev-list call
      git-svn: detect cherry-picks correctly.

Scott Chacon (2):
      mergetool--lib: add p4merge as a pre-configured mergetool option
      Update packfile transfer protocol documentation

Sebastian Schuberth (3):
      Do not try to remove directories when removing old links
      Use faster byte swapping when compiling with MSVC
      Make the MSVC projects use PDB/IDB files named after the project

Shawn O. Pearce (28):
      git-gui: Ensure submodule path is quoted properly
      sha1_file: Fix infinite loop when pack is corrupted
      pkt-line: Add strbuf based functions
      pkt-line: Make packet_read_line easier to debug
      fetch-pack: Use a strbuf to compose the want list
      Move "get_ack()" back to fetch-pack
      Add multi_ack_detailed capability to fetch-pack/upload-pack
      remote-curl: Refactor walker initialization
      fetch: Allow transport -v -v -v to set verbosity to 3
      remote-helpers: Fetch more than one ref in a batch
      remote-helpers: Support custom transport options
      Move WebDAV HTTP push under remote-curl
      Git-aware CGI to provide dumb HTTP transport
      Add stateless RPC options to upload-pack, receive-pack
      Smart fetch and push over HTTP: server side
      Discover refs via smart HTTP server when available
      Smart push over HTTP: client side
      Smart fetch over HTTP: client side
      Smart HTTP fetch: gzip requests
      http tests: use /dumb/ URL prefix
      test smart http fetch and push
      http-backend: Use http.getanyfile to disable dumb HTTP serving
      http-backend: Test configuration options
      Git-aware CGI to provide dumb HTTP transport
      http-backend: Protect GIT_PROJECT_ROOT from /../ requests
      t5551-http-fetch: Work around some libcurl versions
      t5551-http-fetch: Work around broken Accept header in libcurl
      http-backend: Fix bad treatment of uintmax_t in Content-Length

Sitaram Chamarty (1):
      gitk: Disable checkout of remote branches

Stephen Boyd (13):
      rebase -i: fix reword when using a terminal editor
      gitweb: linkify author/committer names with search
      t1402: Make test executable
      t1200: cleanup and modernize test style
      t1200: Make documentation and test agree
      git-add.txt: fix formatting of --patch section
      t3101: test more ls-tree options
      ls-tree: migrate to parse-options
      gitweb.js: fix null object exception in initials calculation
      instaweb: restart server if already running
      gitweb.js: fix padLeftStr() and its usage
      api-strbuf.txt: fix typos and document launch_editor()
      technical-docs: document hash API

Tarmigan Casebolt (3):
      Check the format of more printf-type functions
      http-backend: Fix access beyond end of string.
      http-backend: Let gcc check the format of more printf-type functions.

Tay Ray Chuan (3):
      http-push: fix check condition on http.c::finish_http_pack_request()
      t5540-http-push: remove redundant fetches
      remote-curl.c: fix rpc_out()

Thiago Farina (1):
      Documentation: update pt-BR

Thomas Rast (15):
      bash completion: complete refs for git-grep
      Let --decorate show HEAD position
      Refactor pretty_print_commit arguments into a struct
      reflog-walk: refactor the branch@{num} formatting
      Introduce new pretty formats %g[sdD] for reflog information
      stash list: use new %g formats instead of sed
      stash list: drop the default limit of 10 stashes
      Quote ' as \(aq in manpages
      describe: when failing, tell the user about options that work
      filter-branch: stop special-casing $filter_subdir argument
      filter-branch: nearest-ancestor rewriting outside subdir filter
      Documentation: clarify 'ours' merge strategy
      rebase docs: clarify --merge and --strategy
      Document git-svn's first-parent rule
      describe: do not use unannotated tag even if exact match

Tim Henigan (2):
      Update 'git remote update' usage string to match man page.
      git remote: Separate usage strings for subcommands

Toby Allsopp (1):
      git svn: handle SVN merges from revisions past the tip of the branch

Todd Zullinger (2):
      Makefile: Ensure rpm packages can be read by older rpm versions
      Documentation: Avoid use of xmlto --stringparam

Uwe Kleine-König (1):
      shortlog: respect commit encoding

Vietor Liu (2):
      git-gui: adjust the minimum height of diff pane for shorter screen height
      imap-send.c: fix compiler warnings for OpenSSL 1.0

Štěpán Němec (1):
      git-update-index.txt: Document the --really-refresh option.

^ permalink raw reply

* Re: git-svn: handling merge-base failures
From: Eric Wong @ 2009-12-23 20:57 UTC (permalink / raw)
  To: Andrew Myrick; +Cc: git, Sam Vilain
In-Reply-To: <940F72F6-8FE5-42AE-84A1-8C4A77B57188@apple.com>

Andrew Myrick <amyrick@apple.com> wrote:
> On Dec 23, 2009, at 12:09 PM, Eric Wong wrote:
> > Andrew Myrick <amyrick@apple.com> wrote:
> >> One of my projects is failing to clone because merge-base is failing
> >> on one of the revisions; the branch is a partial branch, so merge-base
> >> can't find a common ancestor with trunk.  I'd like to catch the
> >> exception that command_oneline should throw when merge-base fails, but
> >> my perl is very rusty and I'm struggling to get git-svn.perl to grok
> >> the Git::Error::Command class.  What is the appropriate way to import
> >> that class?  Or more generally, is there a better solution to handling
> >> this error case?
> > 
> > Hi Andrew,
> > 
> > Git::Error::Command should be imported with the rest of Git.pm
> > 
> > It's a special way of doing exceptions in Perl which I don't see much
> > point of...  Looking at git-send-email as an example, it does this:
> > 
> > 	use Error qw(:try);
> > 	use Git;
> > 
> > 	try {
> > 		# something that will throw
> > 	} catch Git::Error::Command with {
> > 		# error handling
> > 	}
> 
> I looked at git-send-email's example, but I wanted to do a bit more:
> 	
> 	try {
> 		# command_oneline(...);
> 	} catch Git::Error::Command with {
> 		$E = shift;
> 		if ($E->value() == 1) {
> 			# do something
> 		} else {
> 			# do something else
> 		}
> 	}
>  	
> This is used in perl/Git.pm, but when I tried it in git-svn.perl, it
> fails with the error "Can't locate object method 'value' via package
> 'Git::SVN'".

That's strange.  I'm at a bit of a loss here so I'll wait for somebody
with more Perl knowledge than myself.

What happens when you dump @_ in your catch block?

	use Data::Dumper;
	try {
	} catch Git::Error::Command with {
		print STDERR Dumper(\@_);
	}

> Presumably $@ contains the Git::Error::Command object, which leaves me
> in the same spot, unfortunately.
> 
> > But yes, it is Perl after all and TMTOWTDI :)
> 
> Is there ever :)

Yes I'm lost here, too, so in these cases I default to putting
print statements everywhere and Data::Dumper :)

-- 
Eric Wong

^ permalink raw reply


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