Git development
 help / color / mirror / Atom feed
* [PATCH] gitweb: Fix snapshots requested via PATH_INFO
From: Holger Weiß @ 2009-03-31 16:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git List

Fix the detection of the requested snapshot format, which failed for
PATH_INFO URLs since the references to the hashes which describe the
supported snapshot formats weren't dereferenced appropriately.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
---
 gitweb/gitweb.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 33ef190..3f99361 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -688,10 +688,10 @@ sub evaluate_path_info {
 		# extensions. Allowed extensions are both the defined suffix
 		# (which includes the initial dot already) and the snapshot
 		# format key itself, with a prepended dot
-		while (my ($fmt, %opt) = each %known_snapshot_formats) {
+		while (my ($fmt, $opt) = each %known_snapshot_formats) {
 			my $hash = $refname;
 			my $sfx;
-			$hash =~ s/(\Q$opt{'suffix'}\E|\Q.$fmt\E)$//;
+			$hash =~ s/(\Q$opt->{'suffix'}\E|\Q.$fmt\E)$//;
 			next unless $sfx = $1;
 			# a valid suffix was found, so set the snapshot format
 			# and reset the hash parameter
-- 
1.6.2.1

^ permalink raw reply related

* [PATCH] Cleanup warning about known issues in cvsimport documentation
From: Heiko Voigt @ 2009-03-31 16:45 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git
In-Reply-To: <7v4oxaa506.fsf@gitster.siamese.dyndns.org>

Not all statements were complete sentences.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
---
 Documentation/git-cvsimport.txt |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt
index e1fd047..ba6a50b 100644
--- a/Documentation/git-cvsimport.txt
+++ b/Documentation/git-cvsimport.txt
@@ -173,24 +173,26 @@ ISSUES
 Problems related to timestamps:
 
  * If timestamps of commits in the cvs repository are not stable enough
-   to be used for ordering commits
+   to be used for ordering commits changes may show up in the wrong
+   order.
  * If any files were ever "cvs import"ed more than once (e.g., import of
-   more than one vendor release)
+   more than one vendor release) the HEAD will be incorrect.
  * If the timestamp order of different files cross the revision order
-   within the commit matching time window
+   within the commit matching time window the order of commits may be
+   wrong.
 
 Problems related to branches:
 
- * Branches on which no commits have been made are not imported
+ * Branches on which no commits have been made are not imported.
  * All files from the branching point are added to a branch even if
-   never added in cvs
- * files added to the source branch *after* a daughter branch was
-   created: If previously no commit was made on the daugther branch they
-   will erroneously be added to the daughter branch in git
+   never added in cvs.
+ * This applies to files added to the source branch *after* a daughter
+   branch was created: If previously no commit was made on the daugther
+   branch they will erroneously be added to the daughter branch in git.
 
 Problems related to tags:
 
-* Multiple tags on the same revision are not imported
+* Multiple tags on the same revision are not imported.
 
 If you suspect that any of these issues may apply to the repository you
 want to import consider using these alternative tools which proved to be
-- 
1.6.1.2.390.gba743

^ permalink raw reply related

* [PATCH] cvsimport: Add a note about crlf options to the documentation
From: Heiko Voigt @ 2009-03-31 16:53 UTC (permalink / raw)
  To: Ferry Huberts (Pelagic); +Cc: Junio C Hamano, git
In-Reply-To: <20090331162103.GA72569@macbook.lan>

---
This is a proper resend of the crlf note patch for Junio's import convenience

 Documentation/git-cvsimport.txt |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt
index e1fd047..d4e7fd4 100644
--- a/Documentation/git-cvsimport.txt
+++ b/Documentation/git-cvsimport.txt
@@ -40,6 +40,11 @@ probably want to make a bare clone of the imported repository,
 and use the clone as the shared repository.
 See linkgit:gitcvs-migration[7].
 
+Note: All revisions are imported using the index so settings of
+core.autocrlf and core.safecrlf are applied. This way you can change or
+safety check the import. If you do not want this make sure these options
+are both set to false.
+
 
 OPTIONS
 -------
-- 
1.6.1.2.390.gba743

^ permalink raw reply related

* [PATCH] Documentation: Remove an odd "instead"
From: Holger Weiß @ 2009-03-31 16:57 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git List

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
---
 Documentation/git-clone.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 95f08b9..4072f40 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -117,7 +117,7 @@ then the cloned repository will become corrupt.
 --origin <name>::
 -o <name>::
 	Instead of using the remote name 'origin' to keep track
-	of the upstream repository, use <name> instead.
+	of the upstream repository, use <name>.
 
 --upload-pack <upload-pack>::
 -u <upload-pack>::
-- 
1.6.2.1

^ permalink raw reply related

* [PATCH 0/2] speed up reflog unreachability pruning
From: Linus Torvalds @ 2009-03-31 17:03 UTC (permalink / raw)
  To: Junio C Hamano, Git Mailing List


Ok, this is a two-patch series that first tries to clean things up a bit, 
and then applies Junio's approach to speed up the reachability test.

The reason I did it this way is that I think we can improve on the 
reachability logic a bit more, but in order to do that I refuse to work 
with the crazy duplicated complex logic inside 'expire_reflog_ent()', and 
I wanted to abstract it out.

Then, the first cut at speedup is just Junio's approach. Which is fairly 
hacky, but works.

I'd _like_ to do more of a "dynamically do 'mark_reachable()' only when 
necessary" thing, but that's a separate cleanup thing.

As is, this improves the reflog expire quite enormously for me:

 - before:

	[torvalds@nehalem linux]$ time git reflog expire --all
	real	0m37.193s
	user	0m37.174s
	sys	0m0.020s

 - after:

	[torvalds@nehalem linux]$ time ~/git/git reflog expire --all
	real	0m1.693s
	user	0m1.672s
	sys	0m0.020s

although I do suspect that the 'mark_reachable()' could slow things down 
in some less extreme cases. But probably never by a huge amount.

Total diffstat:

 builtin-reflog.c |   75 +++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 69 insertions(+), 6 deletions(-)

with the two individual patches coming up next.

			Linus

^ permalink raw reply

* Re: [PATCH] Add warning about known issues to documentation of cvsimport
From: Ferry Huberts (Pelagic) @ 2009-03-31 17:10 UTC (permalink / raw)
  To: Heiko Voigt; +Cc: Junio C Hamano, git
In-Reply-To: <20090331162103.GA72569@macbook.lan>

Heiko Voigt wrote:
> On Tue, Mar 31, 2009 at 07:36:16AM +0200, Ferry Huberts (Pelagic) wrote:
>> Heiko Voigt wrote:
>>> On Mon, Mar 23, 2009 at 09:33:55PM +0100, Ferry Huberts (Pelagic) wrote:
>>>> maybe you can also add remarks about autocrlf and safecrlf?
>>>> both need to be off
>>> From my experience thats not necessarily true. You can use
>>> autocrlf=input to repair broken revisions were crlf's have been
>>> mistakenly committed into the repository. And if I remember correctly
>>> safecrlf helps if you want to make sure that no information gets lost.
>>>
>>> So when importing from a nice correct cvs repository you would expect
>>> safecrlf to not stop your import. And I suspect there are actually cvs
>>> users that were very careful with their lineendings who would use it.
>>>
>>> cheers Heiko
>> If you look at this thread:
>> http://thread.gmane.org/gmane.comp.version-control.git/110152/focus=110358
>> you'll see why I said it. I did some testing to prove my statement.
> 
> Well, from that thread I see my statement supported. It is not true that
> they *need* to be off. Maybe a statement that certain crlf settings are
> exclusive would be good, but I agree that should go into the config
> documentation.
> 
> The main point I see here is that the User may not be aware that such a
> conversion is applied so something like this could help.
> 
> cheers Heiko
> 
> diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt
> index e1fd047..d4e7fd4 100644
> --- a/Documentation/git-cvsimport.txt
> +++ b/Documentation/git-cvsimport.txt
> @@ -40,6 +40,11 @@ probably want to make a bare clone of the imported repository
>  and use the clone as the shared repository.
>  See linkgit:gitcvs-migration[7].
>  
> +Note: All revisions are imported using the index so settings of
> +core.autocrlf and core.safecrlf are applied. This way you can change or
> +safety check the import. If you do not want this make sure these options
> +are both set to false.
> +
>  

I can agree with this. However,
I still think that this is too weak a statement and a bit too cryptic:
the import will/can actually fail when a crlf conversion is performed,
even though safecrlf is not set to true. At least that was the case I
was talking about in the thread. I don't know the current situation, I
haven't tried it since 'cause I just use it with both set to false :-)
I discussed a patch for this but never got around to implementing it
since I'm now busy with ignore functionality for EGit.

cheers.

Ferry

^ permalink raw reply

* [PATCH 1/2] Clean up reflog unreachability pruning decision
From: Linus Torvalds @ 2009-03-31 17:09 UTC (permalink / raw)
  To: Junio C Hamano, Git Mailing List
In-Reply-To: <alpine.LFD.2.00.0903310958000.4093@localhost.localdomain>


From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Tue, 31 Mar 2009 09:45:22 -0700

This clarifies the pruning rules for unreachable commits by having a 
separate helpder function for the unreachability decision.

It's preparation for actual bigger changes to come to speed up the
decision when the reachability calculations become a bottleneck.

In the process it also _does_ change behavior, although in a way that I 
think is much saner than the old behavior (which was in my opinion not 
designed, just a result of how the tests were written). It now will prune 
reflog entries that are older than that 'prune_unreacable' time _and_ that 
have commit references that can't be even looked up.

Of course, "--stale-fix" also does that, and does it regardless of the age 
of the reflog entry is, but I really think this is the right thing to do. 
If we can't even look it up, we should consider it to be unreachable.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 builtin-reflog.c |   32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)

Note the behavioural change. I think it's sane and "ObviouslyCorrect(tm)", 
but maybe somebody disagrees.

diff --git a/builtin-reflog.c b/builtin-reflog.c
index d95f515..0355ce6 100644
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -209,6 +209,31 @@ static int keep_entry(struct commit **it, unsigned char *sha1)
 	return 1;
 }
 
+static int unreachable(struct expire_reflog_cb *cb, struct commit *commit, unsigned char *sha1)
+{
+	/*
+	 * We may or may not have the commit yet - if not, look it
+	 * up using the supplied sha1.
+	 */
+	if (!commit) {
+		if (is_null_sha1(sha1))
+			return 0;
+
+		commit = lookup_commit_reference_gently(sha1, 1);
+
+		/* We can't even look it up - consider it unreachable */
+		if (!commit)
+			return 1;
+	}
+
+	/* Reachable from the current reflog top? Don't prune */
+	if (in_merge_bases(commit, &cb->ref_commit, 1))
+		return 0;
+
+	/* We can't reach it - prune it. */
+	return 1;
+}
+
 static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
 		const char *email, unsigned long timestamp, int tz,
 		const char *message, void *cb_data)
@@ -230,12 +255,7 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
 	if (timestamp < cb->cmd->expire_unreachable) {
 		if (!cb->ref_commit)
 			goto prune;
-		if (!old && !is_null_sha1(osha1))
-			old = lookup_commit_reference_gently(osha1, 1);
-		if (!new && !is_null_sha1(nsha1))
-			new = lookup_commit_reference_gently(nsha1, 1);
-		if ((old && !in_merge_bases(old, &cb->ref_commit, 1)) ||
-		    (new && !in_merge_bases(new, &cb->ref_commit, 1)))
+		if (unreachable(cb, old, osha1) || unreachable(cb, new, nsha1))
 			goto prune;
 	}
 
-- 
1.6.2.1.404.gb0085.dirty

^ permalink raw reply related

* [PATCH 2/2] Speed up reflog pruning of unreachable commits
From: Linus Torvalds @ 2009-03-31 17:11 UTC (permalink / raw)
  To: Junio C Hamano, Git Mailing List
In-Reply-To: <alpine.LFD.2.00.0903311003490.4093@localhost.localdomain>


From: Junio Hamano <gitster@pobox.com>
Date: Mon, 30 Mar 2009 21:34:14 -0700

Instead of doing the (potentially very expensive) "in_merge_base()"
check for each commit that might be pruned if it is unreachable, do a
preparatory reachability graph of the commit space, so that the common
case of being reachable can be tested directly.

[ Cleaned up a bit and tweaked to actually work.  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 builtin-reflog.c |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/builtin-reflog.c b/builtin-reflog.c
index 0355ce6..f29ab2f 100644
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -52,6 +52,7 @@ struct collect_reflog_cb {
 
 #define INCOMPLETE	(1u<<10)
 #define STUDYING	(1u<<11)
+#define REACHABLE	(1u<<12)
 
 static int tree_is_complete(const unsigned char *sha1)
 {
@@ -209,6 +210,43 @@ static int keep_entry(struct commit **it, unsigned char *sha1)
 	return 1;
 }
 
+static void mark_reachable(struct commit *commit, unsigned long expire_limit)
+{
+	/*
+	 * We need to compute if commit on either side of an reflog
+	 * entry is reachable from the tip of the ref for all entries.
+	 * Mark commits that are reachable from the tip down to the
+	 * time threashold first; we know a commit marked thusly is
+	 * reachable from the tip without running in_merge_bases()
+	 * at all.
+	 */
+	struct commit_list *pending = NULL;
+
+	commit_list_insert(commit, &pending);
+	while (pending) {
+		struct commit_list *entry = pending;
+		struct commit_list *parent;
+		pending = entry->next;
+		commit = entry->item;
+		free(entry);
+		if (commit->object.flags & REACHABLE)
+			continue;
+		if (parse_commit(commit))
+			continue;
+		commit->object.flags |= REACHABLE;
+		if (commit->date < expire_limit)
+			continue;
+		parent = commit->parents;
+		while (parent) {
+			commit = parent->item;
+			parent = parent->next;
+			if (commit->object.flags & REACHABLE)
+				continue;
+			commit_list_insert(commit, &pending);
+		}
+	}
+}
+
 static int unreachable(struct expire_reflog_cb *cb, struct commit *commit, unsigned char *sha1)
 {
 	/*
@@ -227,6 +265,8 @@ static int unreachable(struct expire_reflog_cb *cb, struct commit *commit, unsig
 	}
 
 	/* Reachable from the current reflog top? Don't prune */
+	if (commit->object.flags & REACHABLE)
+		return 0;
 	if (in_merge_bases(commit, &cb->ref_commit, 1))
 		return 0;
 
@@ -308,7 +348,10 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
 	cb.ref_commit = lookup_commit_reference_gently(sha1, 1);
 	cb.ref = ref;
 	cb.cmd = cmd;
+
+	mark_reachable(cb.ref_commit, cmd->expire_total);
 	for_each_reflog_ent(ref, expire_reflog_ent, &cb);
+	clear_commit_marks(cb.ref_commit, REACHABLE);
  finish:
 	if (cb.newlog) {
 		if (fclose(cb.newlog)) {
-- 
1.6.2.1.404.gb0085.dirty

^ permalink raw reply related

* Re: bsd group semantics
From: Junio C Hamano @ 2009-03-31 17:32 UTC (permalink / raw)
  To: Jeff King; +Cc: Alex Riesen, git
In-Reply-To: <20090331160842.GA9019@coredump.intra.peff.net>

Jeff King <peff@peff.net> writes:

> On Tue, Mar 31, 2009 at 08:55:00AM -0700, Junio C Hamano wrote:
> ...
>> Ideally the test should be checking if the subdirectory is owned by the
>> same group as the toplevel, but that is rather hard to correctly arrange,
>> as it depends on the set of groups the user who runs the test belongs to,
>> how the git work tree is set up (if it is owned by his primary group or a
>> secondary), etc.
>
> Shouldn't that just be:
>
>   perl -e 'sub group { return (stat(shift))[5] }' \
>        -e 'exit group($ARGV[0]) == group($ARGV[1]) ? 0 : 1' \
>        a b
>
> ?

My point was if I belong only to my personal group and git.git work tree
is owned by junio.junio to begin with, you would never be able to notice
any breakage with such a test.

^ permalink raw reply

* Re: [PATCH 1/2] Clean up reflog unreachability pruning decision
From: Junio C Hamano @ 2009-03-31 17:44 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Git Mailing List
In-Reply-To: <alpine.LFD.2.00.0903311003490.4093@localhost.localdomain>

Linus Torvalds <torvalds@linux-foundation.org> writes:

> From: Linus Torvalds <torvalds@linux-foundation.org>
> Date: Tue, 31 Mar 2009 09:45:22 -0700
>
> This clarifies the pruning rules for unreachable commits by having a 
> separate helpder function for the unreachability decision.
>
> It's preparation for actual bigger changes to come to speed up the
> decision when the reachability calculations become a bottleneck.
>
> In the process it also _does_ change behavior, although in a way that I 
> think is much saner than the old behavior (which was in my opinion not 
> designed, just a result of how the tests were written). It now will prune 
> reflog entries that are older than that 'prune_unreacable' time _and_ that 
> have commit references that can't be even looked up.

> Of course, "--stale-fix" also does that, and does it regardless of the age 
> of the reflog entry is, but I really think this is the right thing to do. 
> If we can't even look it up, we should consider it to be unreachable.
>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> ---
>  builtin-reflog.c |   32 ++++++++++++++++++++++++++------
>  1 files changed, 26 insertions(+), 6 deletions(-)
>
> Note the behavioural change. I think it's sane and "ObviouslyCorrect(tm)", 
> but maybe somebody disagrees.

I did not recall initially when I was discussing this with you last night
but I think this "no commit? not prune" is intentional.  The codepath is
not about logs/heads but logs/*anything*, and we allow pointers to non
commit objects (like v2.6.11-tree).

Also even if we limit ourselves to commits, @{-N} notation can be used to
see the history of branch switching, and that does not need any underlying
objects.  I do not think it is interesting to be able to see which branch
you were on 30 days abo, though ;-)


> diff --git a/builtin-reflog.c b/builtin-reflog.c
> index d95f515..0355ce6 100644
> --- a/builtin-reflog.c
> +++ b/builtin-reflog.c
> @@ -209,6 +209,31 @@ static int keep_entry(struct commit **it, unsigned char *sha1)
>  	return 1;
>  }
>  
> +static int unreachable(struct expire_reflog_cb *cb, struct commit *commit, unsigned char *sha1)
> +{
> +	/*
> +	 * We may or may not have the commit yet - if not, look it
> +	 * up using the supplied sha1.
> +	 */
> +	if (!commit) {
> +		if (is_null_sha1(sha1))
> +			return 0;
> +
> +		commit = lookup_commit_reference_gently(sha1, 1);
> +
> +		/* We can't even look it up - consider it unreachable */
> +		if (!commit)
> +			return 1;

	/* If it is not a commit, keep it. */
        if (!commit)
        	return 0;

> +	}
> +
> +	/* Reachable from the current reflog top? Don't prune */

That's "tip of the ref", not necessarily "reflog top".

> +	if (in_merge_bases(commit, &cb->ref_commit, 1))
> +		return 0;
> +
> +	/* We can't reach it - prune it. */
> +	return 1;
> +}
> +
>  static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
>  		const char *email, unsigned long timestamp, int tz,
>  		const char *message, void *cb_data)
> @@ -230,12 +255,7 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
>  	if (timestamp < cb->cmd->expire_unreachable) {
>  		if (!cb->ref_commit)
>  			goto prune;
> -		if (!old && !is_null_sha1(osha1))
> -			old = lookup_commit_reference_gently(osha1, 1);
> -		if (!new && !is_null_sha1(nsha1))
> -			new = lookup_commit_reference_gently(nsha1, 1);
> -		if ((old && !in_merge_bases(old, &cb->ref_commit, 1)) ||
> -		    (new && !in_merge_bases(new, &cb->ref_commit, 1)))
> +		if (unreachable(cb, old, osha1) || unreachable(cb, new, nsha1))
>  			goto prune;
>  	}
>  
> -- 
> 1.6.2.1.404.gb0085.dirty

^ permalink raw reply

* Re: [PATCH 2/2] Speed up reflog pruning of unreachable commits
From: Junio C Hamano @ 2009-03-31 17:46 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Git Mailing List
In-Reply-To: <alpine.LFD.2.00.0903311010050.4093@localhost.localdomain>

Linus Torvalds <torvalds@linux-foundation.org> writes:

> From: Junio Hamano <gitster@pobox.com>
> Date: Mon, 30 Mar 2009 21:34:14 -0700
>
> Instead of doing the (potentially very expensive) "in_merge_base()"
> check for each commit that might be pruned if it is unreachable, do a
> preparatory reachability graph of the commit space, so that the common
> case of being reachable can be tested directly.
>
> [ Cleaned up a bit and tweaked to actually work.  - Linus ]
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> ---
>  builtin-reflog.c |   43 +++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 43 insertions(+), 0 deletions(-)
>
> diff --git a/builtin-reflog.c b/builtin-reflog.c
> index 0355ce6..f29ab2f 100644
> --- a/builtin-reflog.c
> +++ b/builtin-reflog.c
> @@ -52,6 +52,7 @@ struct collect_reflog_cb {
>  
>  #define INCOMPLETE	(1u<<10)
>  #define STUDYING	(1u<<11)
> +#define REACHABLE	(1u<<12)
>  
>  static int tree_is_complete(const unsigned char *sha1)
>  {
> @@ -209,6 +210,43 @@ static int keep_entry(struct commit **it, unsigned char *sha1)
>  	return 1;
>  }
>  
> +static void mark_reachable(struct commit *commit, unsigned long expire_limit)
> +{
> +	/*
> +	 * We need to compute if commit on either side of an reflog
> +	 * entry is reachable from the tip of the ref for all entries.
> +	 * Mark commits that are reachable from the tip down to the
> +	 * time threashold first; we know a commit marked thusly is
> +	 * reachable from the tip without running in_merge_bases()
> +	 * at all.
> +	 */
> +	struct commit_list *pending = NULL;
> +
> +	commit_list_insert(commit, &pending);
> +	while (pending) {
> +		struct commit_list *entry = pending;
> +		struct commit_list *parent;
> +		pending = entry->next;
> +		commit = entry->item;
> +		free(entry);
> +		if (commit->object.flags & REACHABLE)
> +			continue;
> +		if (parse_commit(commit))
> +			continue;
> +		commit->object.flags |= REACHABLE;
> +		if (commit->date < expire_limit)
> +			continue;
> +		parent = commit->parents;
> +		while (parent) {
> +			commit = parent->item;
> +			parent = parent->next;
> +			if (commit->object.flags & REACHABLE)
> +				continue;
> +			commit_list_insert(commit, &pending);
> +		}
> +	}
> +}
> +
>  static int unreachable(struct expire_reflog_cb *cb, struct commit *commit, unsigned char *sha1)
>  {
>  	/*
> @@ -227,6 +265,8 @@ static int unreachable(struct expire_reflog_cb *cb, struct commit *commit, unsig
>  	}
>  
>  	/* Reachable from the current reflog top? Don't prune */
> +	if (commit->object.flags & REACHABLE)
> +		return 0;
>  	if (in_merge_bases(commit, &cb->ref_commit, 1))
>  		return 0;
>  
> @@ -308,7 +348,10 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
>  	cb.ref_commit = lookup_commit_reference_gently(sha1, 1);
>  	cb.ref = ref;
>  	cb.cmd = cmd;
> +

You seem to have lost "if (cb.ref_commit)" from the last round to protect
mark_rechable().  It can be NULL.

> +	mark_reachable(cb.ref_commit, cmd->expire_total);
>  	for_each_reflog_ent(ref, expire_reflog_ent, &cb);
> +	clear_commit_marks(cb.ref_commit, REACHABLE);
>   finish:
>  	if (cb.newlog) {
>  		if (fclose(cb.newlog)) {
> -- 
> 1.6.2.1.404.gb0085.dirty

^ permalink raw reply

* Re: Detached HEAD warning (again)
From: Pieter de Bie @ 2009-03-31 17:59 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Git Mailing List
In-Reply-To: <alpine.DEB.1.00.0903311203490.10279@pacific.mpi-cbg.de>


On Mar 31, 2009, at 11:04 AM, Johannes Schindelin wrote:

>> 	$ git submodule update --init
>> 	# sub/ is created
>> 	$ (cd sub && touch a && git add a && git commit -am "Add new file")
>> 	[detached HEAD 8641889] Add new file
>> 	 0 files changed, 0 insertions(+), 0 deletions(-)
>> 	 create mode 100644 a
>>
>> 	$ git submodule update
>> 	$ ls sub/a
>> 	ls: sub/a: No such file or directory
>
> 	$ cd sub
> 	$ git checkout HEAD@{1}

Yes, I know that the commits can still be recovered
(otherwise this would be a much bigger issue), but 'git
reflog' has never been a necessary part of a workflow, has
it? It's nifty and can be very useful in situations where you
accidentally lost something, but you can hardly call this a
nice workflow or expect people that use submodules to know
about this.

- Pieter

^ permalink raw reply

* Re: [PATCH 2/2] Speed up reflog pruning of unreachable commits
From: Linus Torvalds @ 2009-03-31 17:58 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List
In-Reply-To: <7v63hp60vi.fsf@gitster.siamese.dyndns.org>



On Tue, 31 Mar 2009, Junio C Hamano wrote:
> 
> You seem to have lost "if (cb.ref_commit)" from the last round to protect
> mark_rechable().  It can be NULL.

I based it on your original patch, so yeah, it's missing all your updates 
since.

			Linus

^ permalink raw reply

* [PATCH] Allow any HTTP authentication scheme, not only basic
From: Martin Storsjo @ 2009-03-31 17:31 UTC (permalink / raw)
  To: git

Signed-off-by: Martin Storsjo <martin@martin.st>
---
 http.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/http.c b/http.c
index 2fc55d6..7cb53e8 100644
--- a/http.c
+++ b/http.c
@@ -165,6 +165,7 @@ static CURL *get_curl_handle(void)
 #if LIBCURL_VERSION_NUM >= 0x070907
 	curl_easy_setopt(result, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
 #endif
+	curl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
 
 	init_curl_http_auth(result);
 
-- 
1.6.0.2

^ permalink raw reply related

* Re: [PATCH 6/8 v2] sh-tools: add a run_merge_tool function
From: James Pickens @ 2009-03-31 18:15 UTC (permalink / raw)
  To: David Aguilar; +Cc: gitster, git
In-Reply-To: <1238400684-14881-1-git-send-email-davvid@gmail.com>

On Mon, Mar 30, 2009 at 1:11 AM, David Aguilar <davvid@gmail.com> wrote:
> This function launches merge tools and will be used to refactor
> git-(diff|merge)tool.

Thanks for writing difftool; I find it quite useful.  I tried it with
tkdiff, and noticed that it shows the 'merge preview' window even though it
isn't doing a merge.  If a user with unstaged changes were to carelessly
click the 'save and exit' button, his changes could be lost.  So I think
it's a good idea to stop the merge preview window from showing up under
difftool.  To do that I think you just have to remove the '-o "$MERGED"'
option to tkdiff.

James

^ permalink raw reply

* Re: bsd group semantics
From: Jeff King @ 2009-03-31 18:46 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Alex Riesen, git
In-Reply-To: <7veiwd61k1.fsf@gitster.siamese.dyndns.org>

On Tue, Mar 31, 2009 at 10:32:14AM -0700, Junio C Hamano wrote:

> My point was if I belong only to my personal group and git.git work tree
> is owned by junio.junio to begin with, you would never be able to notice
> any breakage with such a test.

Ah, I see. Yes, you would need to belong to at least two groups to make
such a test feasible.

Such a requirement is generally outside the scope of running the
test suite; do you want to just ditch the g+s test, then, or do you want
me to work up something conditional based on the Makefile flag?

-Peff

^ permalink raw reply

* [PATCH] Add configuration variable for sign-off to format-patch
From: Heiko Voigt @ 2009-03-31 18:50 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

If you regularly create patches which require a Signed-off: line you may
want to make it your default to add that line. It also helps you not to forget
to add the -s/--signoff switch.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
---

Because it happened to me twice already that I forgot to add the switch.

 Documentation/config.txt           |    4 ++++
 Documentation/git-format-patch.txt |    1 +
 builtin-log.c                      |   23 ++++++++++++++++-------
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index ad22cb8..ed85536 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -715,6 +715,10 @@ format.thread::
 	A true boolean value is the same as `shallow`, and a false
 	value disables threading.
 
+format.signoff::
+	This lets you enable the -s/--signoff option of format-patch by
+	default. It takes a boolean value.
+
 gc.aggressiveWindow::
 	The window size parameter used in the delta compression
 	algorithm used by 'git-gc --aggressive'.  This defaults
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index c2eb5fa..c25ea10 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -197,6 +197,7 @@ more than one.
 	numbered = auto
 	cc = <email>
 	attach [ = mime-boundary-string ]
+	signoff = true
 ------------
 
 
diff --git a/builtin-log.c b/builtin-log.c
index c7a5772..d77b7fb 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -465,6 +465,7 @@ static void add_header(const char *value)
 #define THREAD_SHALLOW 1
 #define THREAD_DEEP 2
 static int thread = 0;
+static int do_signoff = 0;
 
 static int git_format_config(const char *var, const char *value, void *cb)
 {
@@ -514,6 +515,10 @@ static int git_format_config(const char *var, const char *value, void *cb)
 		thread = git_config_bool(var, value) && THREAD_SHALLOW;
 		return 0;
 	}
+	if (!strcmp(var, "format.signoff")) {
+		do_signoff = git_config_bool(var, value);
+		return 0;
+	}
 
 	return git_log_config(var, value, cb);
 }
@@ -865,13 +870,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		}
 		else if (!strcmp(argv[i], "--signoff") ||
 			 !strcmp(argv[i], "-s")) {
-			const char *committer;
-			const char *endpos;
-			committer = git_committer_info(IDENT_ERROR_ON_NO_NAME);
-			endpos = strchr(committer, '>');
-			if (!endpos)
-				die("bogus committer info %s", committer);
-			add_signoff = xmemdupz(committer, endpos - committer + 1);
+			do_signoff = 1;
 		}
 		else if (!strcmp(argv[i], "--attach")) {
 			rev.mime_boundary = git_version_string;
@@ -923,6 +922,16 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 	}
 	argc = j;
 
+	if(do_signoff) {
+		const char *committer;
+		const char *endpos;
+		committer = git_committer_info(IDENT_ERROR_ON_NO_NAME);
+		endpos = strchr(committer, '>');
+		if (!endpos)
+			die("bogus committer info %s", committer);
+		add_signoff = xmemdupz(committer, endpos - committer + 1);
+	}
+
 	for (i = 0; i < extra_hdr_nr; i++) {
 		strbuf_addstr(&buf, extra_hdr[i]);
 		strbuf_addch(&buf, '\n');
-- 
1.6.2.1.424.g0b27.dirty

^ permalink raw reply related

* [PATCH] Allow any HTTP authentication scheme, not only basic
From: Martin Storsjo @ 2009-03-31 18:54 UTC (permalink / raw)
  To: git
In-Reply-To: <1238520686-546-1-git-send-email-martin@martin.st>

Signed-off-by: Martin Storsjo <martin@martin.st>
---
Updated patch, enable only on libcurl versions new enough

 http.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/http.c b/http.c
index 2fc55d6..eae74aa 100644
--- a/http.c
+++ b/http.c
@@ -165,6 +165,9 @@ static CURL *get_curl_handle(void)
 #if LIBCURL_VERSION_NUM >= 0x070907
 	curl_easy_setopt(result, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
 #endif
+#if LIBCURL_VERSION_NUM >= 0x070a06
+	curl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
+#endif
 
 	init_curl_http_auth(result);
 
-- 
1.6.0.2

^ permalink raw reply related

* Re: [PATCH] Allow any HTTP authentication scheme, not only basic
From: Johannes Schindelin @ 2009-03-31 19:04 UTC (permalink / raw)
  To: Martin Storsjo; +Cc: git
In-Reply-To: <1238525665-10776-1-git-send-email-martin@martin.st>

Hi,

On Tue, 31 Mar 2009, Martin Storsjo wrote:

> Updated patch, enable only on libcurl versions new enough

Heh, you beat me to looking up from which version onward curl supports 
this...

Thanks!
Dscho

^ permalink raw reply

* Git, C89, and older compilers
From: Joshua Juran @ 2009-03-31 19:26 UTC (permalink / raw)
  To: git

Hello,

I'm porting Git to Lamp (Lamp ain't Mac POSIX), a Unix-like  
environment which runs in classic Mac OS, much like Cygwin.

One of the complications I've run into is that Metrowerks C 2.4.1  
(released in 2001) doesn't support some of the constructs git uses,  
such as initializing an aggregate's member with the address of a  
local variable, illustrated by the patch below:

diff --git a/builtin-commit.c b/builtin-commit.c
index 46e649c..8b98547 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -605,7 +605,8 @@ static int prepare_to_commit(const char  
*index_file, const c

         if (use_editor) {
                 char index[PATH_MAX];
-               const char *env[2] = { index, NULL };
+               const char *env[2] = { NULL, NULL };
+               env[0] = index;
                 snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s",  
index_file);
                 if (launch_editor(git_path(commit_editmsg), NULL,  
env)) {
                         fprintf(stderr,

Is git intended to compile on a C89 compiler?  In any case, if I  
produce a complete set of patches, will they be applied?

Josh

^ permalink raw reply related

* Re: [PATCH] Add warning about known issues to documentation of cvsimport
From: Jeff King @ 2009-03-31 19:40 UTC (permalink / raw)
  To: Heiko Voigt; +Cc: Junio C Hamano, Chris Johnsen, git
In-Reply-To: <20090331112812.GA2090@coredump.intra.peff.net>

On Tue, Mar 31, 2009 at 07:28:12AM -0400, Jeff King wrote:

> On Tue, Mar 31, 2009 at 12:36:46AM +0200, Heiko Voigt wrote:
> 
> > > Note the extra blank line between each heading and its list, and the
> > > lack of a blank line between the end of the first list and the heading
> > > of the second. Your source is very readable, so it really is just
> > > asciidoc being silly, but I wonder if there is a way to work around
> > > that.
> > 
> > My xmlto is not working at the moment. I will check that.
> 
> I looked into it a little more; it happens all over the place, so it is
> a problem somewhere in the documentation toolchain. So don't worry about
> it for this particular patch.

I looked into it more and posted to the docbook-apps list.  Here's what
I found out: the problem is fixed in docbook-xsl 1.74.3. However, our
template to prevent extra .sp in manpage-base.xml prevents it.

That fix is in 7ef0435 (spurious .sp in manpages, 2006-12-13), and I get
good output by reverting it and using docbook 1.74.3.

Going back to the original discussion, it looks like it is a workaround
for docbook-xsl 1.69.0:

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

Assuming that is correct, I think the sane choices are:

  1. drop the workaround, as that version of docbook-xsl is now several
     years old

     or

  2. turn the workaround off by default, but add a knob to turn it on
     (DOCBOOK_XSL_1690?)

Having it on by default and turning it off with a knob seems silly,
since most versions don't need it. Debian stable is shipping 1.73 these
days, which looks fine without 7ef0435. Are there other platforms still
shipping 1.69.0? Is it too old for us to care?

-Peff

^ permalink raw reply

* Re: [PATCH 3/4] send-email: correct two tests which were going interactive
From: Jeff King @ 2009-03-31 19:46 UTC (permalink / raw)
  To: Jay Soffian
  Cc: git, Matthieu Moy, Junio C Hamano, Björn Steinbrink,
	Uwe Kleine-König
In-Reply-To: <232681e20e15a61defb73a1645fd2c6b6aadd751.1238516122.git.jaysoffian@gmail.com>

On Tue, Mar 31, 2009 at 12:22:13PM -0400, Jay Soffian wrote:

> Commit 67f1fe5 added two tests which went interactive under the
> dash shell. This commit corrects the issue. Reported by
> Björn Steinbrink <B.Steinbrink@gmx.de>

Thanks. I was seeing the same issue as Björn, and this fixes it for me.

-Peff

^ permalink raw reply

* Re: [PATCH] Add configuration variable for sign-off to format-patch
From: Andreas Ericsson @ 2009-03-31 19:47 UTC (permalink / raw)
  To: Heiko Voigt; +Cc: git, Junio C Hamano
In-Reply-To: <20090331185018.GD72569@macbook.lan>

Heiko Voigt wrote:
> If you regularly create patches which require a Signed-off: line you may
> want to make it your default to add that line. It also helps you not to forget
> to add the -s/--signoff switch.
> 
> Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
> ---
> 
> Because it happened to me twice already that I forgot to add the switch.
> 
>  Documentation/config.txt           |    4 ++++
>  Documentation/git-format-patch.txt |    1 +
>  builtin-log.c                      |   23 ++++++++++++++++-------
>  3 files changed, 21 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index ad22cb8..ed85536 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -715,6 +715,10 @@ format.thread::
>  	A true boolean value is the same as `shallow`, and a false
>  	value disables threading.
>  
> +format.signoff::
> +	This lets you enable the -s/--signoff option of format-patch by
> +	default. It takes a boolean value.
> +

Can we please make it "formatpatch.signoff" or some such instead? Just
plain "format" is a bit too generic for my taste.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

^ permalink raw reply

* Re: [PATCH] Cleanup warning about known issues in cvsimport documentation
From: Jeff King @ 2009-03-31 19:49 UTC (permalink / raw)
  To: Heiko Voigt; +Cc: Junio C Hamano, git
In-Reply-To: <20090331164503.GB72569@macbook.lan>

On Tue, Mar 31, 2009 at 06:45:03PM +0200, Heiko Voigt wrote:

> Not all statements were complete sentences.

Thanks, this is looking much better. A few minor comments:

>   * If any files were ever "cvs import"ed more than once (e.g., import of
> -   more than one vendor release)
> +   more than one vendor release) the HEAD will be incorrect.

Incorrect how? I assume "contains the wrong content".

> + * This applies to files added to the source branch *after* a daughter
> +   branch was created: If previously no commit was made on the daugther
> +   branch they will erroneously be added to the daughter branch in git.

s/If/if/, s/daugther/daughter/

Other than that, looks good to me.

-Peff

^ permalink raw reply

* Re: [PATCH] Add configuration variable for sign-off to format-patch
From: Jeff King @ 2009-03-31 20:04 UTC (permalink / raw)
  To: Heiko Voigt; +Cc: git, Junio C Hamano
In-Reply-To: <20090331185018.GD72569@macbook.lan>

On Tue, Mar 31, 2009 at 08:50:19PM +0200, Heiko Voigt wrote:

> If you regularly create patches which require a Signed-off: line you may
> want to make it your default to add that line. It also helps you not to forget
> to add the -s/--signoff switch.

I personally have no problem with such an option, but it has been argued
against before. E.g.:

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

There is also some discussion here indicating that it might be accepted:

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

-Peff

^ 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