* Re: [PATCH-v2/RFC 3/6] xutils: fix ignore-all-space on incomplete line
From: Junio C Hamano @ 2009-08-24 6:02 UTC (permalink / raw)
To: Thell Fowler; +Cc: git, Johannes.Schindelin
In-Reply-To: <alpine.DEB.2.00.0908232044060.29625@GWPortableVCS>
Thell Fowler <git@tbfowler.name> writes:
> It passed every test I threw at it, although it seemed to be a tad bit
> slower than the previous revision on my sample data so I ran the following
> command several times for both the previous and current version:
>
> time for i in {1..10}; do ./t4015-diff-whitespace.sh>/dev/null &&
> ./t4015-diff-trailing-whitespace.sh >/dev/null; done
>
> And these results are fairly average on what I saw:
>
> Previous version:
> real 2m32.669s
> user 0m44.051s
> sys 1m34.702s
>
>
> Current version:
> real 2m56.818s
> user 0m47.671s
> sys 1m46.723s
Do you mean by "previous version" the one that was broken, or the one I
sent as a "how about" patch?
Here are the numbers I am getting:
$ /usr/bin/time sh -c 'for i in 1 2 3 4 5 6 7 8 9 0; do ./t4015-diff-whitespace.sh; done' >/dev/null
----------------
1.99user 3.65system 0:05.10elapsed 110%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+12560outputs (0major+1288675minor)pagefaults 0swaps
1.86user 3.66system 0:05.04elapsed 109%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+12560outputs (0major+1288618minor)pagefaults 0swaps
1.76user 3.87system 0:05.02elapsed 112%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+12560outputs (0major+1288973minor)pagefaults 0swaps
----------------
1.81user 3.86system 0:05.08elapsed 111%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+12560outputs (0major+1288836minor)pagefaults 0swaps
1.76user 3.87system 0:04.95elapsed 113%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+12560outputs (0major+1288880minor)pagefaults 0swaps
1.81user 3.88system 0:05.04elapsed 112%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+12560outputs (0major+1288530minor)pagefaults 0swaps
----------------
One set is with patch and one set is the patch reverted. I cannot quite
remember which one is which ;-) but the difference is within the noise for me.
I have to revisit this sometime after getting a long rest.
^ permalink raw reply
* Re: [PATCH] Teach mailinfo to ignore everything before -- >8 -- mark
From: Junio C Hamano @ 2009-08-24 5:36 UTC (permalink / raw)
To: Nicolas Sebrecht; +Cc: Thell Fowler, Nanako Shiraishi, git, Johannes.Schindelin
In-Reply-To: <7vk50tq0g5.fsf@alter.siamese.dyndns.org>
Try this patch, perhaps? I forgot to reset the mysteriously named s_hdr
buffer.
Does anybody remember what these s_hdr (vs p_hdr) buffers stand for, by
the way?
-- >8 -- cut here -- >8 --
Subject: [PATCH] squashme to 925bd84 (Teach mailinfo to ignore everything before -- >8 -- mark, 2009-08-23)
builtin-mailinfo.c | 6 ++++++
t/t5100/sample.mbox | 4 ++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 26548f0..8a3a184 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -758,9 +758,15 @@ static int handle_commit_msg(struct strbuf *line)
}
if (scissors(line)) {
+ int i;
rewind(cmitmsg);
ftruncate(fileno(cmitmsg), 0);
still_looking = 1;
+ for (i = 0; header[i]; i++) {
+ if (s_hdr_data[i])
+ strbuf_release(s_hdr_data[i]);
+ s_hdr_data[i] = NULL;
+ }
return 0;
}
diff --git a/t/t5100/sample.mbox b/t/t5100/sample.mbox
index 95b6842..2c3da52 100644
--- a/t/t5100/sample.mbox
+++ b/t/t5100/sample.mbox
@@ -566,10 +566,14 @@ From: Junio Hamano <junkio@cox.net>
Date: Thu, 20 Aug 2009 17:18:22 -0700
Subject: Why doesn't git-am does not like >8 scissors mark?
+Subject: [PATCH] BLAH ONE
+
In real life, we will see a discussion that inspired this patch
discussing related and unrelated things around >8 scissors mark
in this part of the message.
+Subject: [PATCH] BLAH TWO
+
And the we will see the scissors.
-- >8 -- cut here -- 8< --
^ permalink raw reply related
* Re: [PATCH] Teach mailinfo to ignore everything before -- >8 -- mark
From: Nanako Shiraishi @ 2009-08-24 5:16 UTC (permalink / raw)
To: Nicolas Sebrecht; +Cc: Junio C Hamano, Thell Fowler, git, Johannes.Schindelin
In-Reply-To: <20090824041608.GC3526@vidovic>
Quoting Nicolas Sebrecht <nicolas.s.dev@gmx.fr> writes:
> diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
> index fcacc94..0c9a791 100644
> --- a/Documentation/git-am.txt
> +++ b/Documentation/git-am.txt
> @@ -138,6 +138,9 @@ The commit message is formed by the title taken from
> the
> where the patch begins. Excess whitespace at the end of each
> line is automatically stripped.
>
> +If a line starts with a "-- >8 --" mark in the body of the message,
> +everything before (and the line itself) will be ignored.
Looking at the way other people use the mark in their messages, I think this explanation isn't correct.
A scissors mark doesn't have to be at the beginning. The line has to contain the mark, and it has to consist of only the mark, '-' minus, the phrase "cut here", and whitespaces.
I am not familiar enough with the code to comment on the bug you are reporting.
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply
* Re: [PATCH] Teach mailinfo to ignore everything before -- >8 -- mark
From: Junio C Hamano @ 2009-08-24 4:51 UTC (permalink / raw)
To: Nicolas Sebrecht
Cc: Junio C Hamano, Thell Fowler, Nanako Shiraishi, git,
Johannes.Schindelin
In-Reply-To: <20090824041608.GC3526@vidovic>
Nicolas Sebrecht <nicolas.s.dev@gmx.fr> writes:
> I'd expect that we take the "Subject: " line after the mark and fallback
> to the header if missing.
Patches welcome.
^ permalink raw reply
* Re: [PATCH] fix simple deepening of a repo
From: Junio C Hamano @ 2009-08-24 4:49 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Daniel Barkalow, Johannes Schindelin, git
In-Reply-To: <alpine.LFD.2.00.0908232320410.6044@xanadu.home>
Nicolas Pitre <nico@cam.org> writes:
> If all refs sent by the remote repo during a fetch are reachable
> locally, then no further conversation is performed with the remote. This
> check is skipped when the --depth argument is provided to allow the
> deepening of a shallow clone which corresponding remote repo has no
> changed.
>
> However, some additional filtering was added in commit c29727d5 to
> remove those refs which are equal on both sides. If the remote repo has
> not changed, then the list of refs to give the remote process becomes
> empty and simply attempting to deepen a shallow repo always fails.
>
> Let's stop being smart in that case and simply send the whole list over
> when that condition is met. The remote will do the right thing anyways.
>
> Test cases for this issue are also provided.
>
> Signed-off-by: Nicolas Pitre <nico@cam.org>
> ---
Thanks. The fix looks correct (as usual with patches from you).
But it makes me wonder if this logic to filter refs is buying us anything.
> for (rm = refs; rm; rm = rm->next) {
> + nr_refs++;
> if (rm->peer_ref &&
> !hashcmp(rm->peer_ref->old_sha1, rm->old_sha1))
> continue;
ALLOC_GROW(heads, nr_heads + 1, nr_alloc);
heads[nr_heads++] = rm;
}
What is the point of not asking for the refs that we know are the same?
In other words, what breaks (not necessarily in the correctness sense, but
also in the performance sense) if we get rid of this filtering altogether?
Over a native protocol, we will tell the other end what we have and the
remote end will notice that we are asking for the same thing, so it won't
include unnecessary objects in the pack anyway. When calling out to a
walker, we will also notice that the ref matches what we have already and
will not fetch anything from the remote. Because the commit at the tip of
the ref that is already up-to-date is marked as COMPLETE, we will not even
locally have to walk the object chain to make sure things are connected.
I think the only thing that this possibly gains is if _everything_ is up
to date. Then we won't need to make a call to transport->fetch() and it
would save a new connection.
But that optimization is already done long ago by the caller's
quickfetch() in the normal case.
Which makes me suspect that the real fix should be something a lot
simpler, like this (untested) patch.
diff --git a/transport.c b/transport.c
index f231b35..14dab81 100644
--- a/transport.c
+++ b/transport.c
@@ -1053,18 +1053,16 @@ const struct ref *transport_get_remote_refs(struct transport *transport)
int transport_fetch_refs(struct transport *transport, const struct ref *refs)
{
int rc;
- int nr_heads = 0, nr_alloc = 0;
+ int nr_heads = 0;
const struct ref **heads = NULL;
const struct ref *rm;
- for (rm = refs; rm; rm = rm->next) {
- if (rm->peer_ref &&
- !hashcmp(rm->peer_ref->old_sha1, rm->old_sha1))
- continue;
- ALLOC_GROW(heads, nr_heads + 1, nr_alloc);
+ for (rm = refs; rm; rm = rm->next)
+ nr_heads++;
+ heads = xmalloc(nr_heads * sizeof(*heads));
+ nr_heads = 0;
+ for (rm = refs; rm; rm = rm->next)
heads[nr_heads++] = rm;
- }
-
rc = transport->fetch(transport, nr_heads, heads);
free(heads);
return rc;
^ permalink raw reply related
* [PATCH] Teach mailinfo to ignore everything before -- >8 -- mark
From: Nicolas Sebrecht @ 2009-08-24 4:16 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Thell Fowler, Nanako Shiraishi, git, Johannes.Schindelin
In-Reply-To: <7v7hwurwmu.fsf@alter.siamese.dyndns.org>
Subject: [PATCH] Wong title
From: is this one really the author? <email@somebody.dom>
The 23/08/09, Junio C Hamano wrote:
>
> >> > Subject: [PATCH] Teach mailinfo to ignore everything before -- >8 -- mark
>
> The one I sent out had two bugs. Please discard and replace it with a
> newer one I'll be pushing out on 'pu' later today.
( Tested against current 925bd84 in pu. )
If we have a mail with this form
<header>
Subject: [PATCH] BLAH ONE
</header>
Subject: [PATCH] BLAH TWO
<...>
-- >8 --
Subject: [PATCH] BLAH THREE
the commit message looks like
BLAH TWO
Subject: [PATCH] BLAH THREE
I'd expect that we take the "Subject: " line after the mark and fallback
to the header if missing.
Same applies to the "From: " lines.
This mail should be usable to your own tests.
-- >8 -- Please squash this to 925bd84 -- >8 --
Signed-off-by: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
---
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index fcacc94..0c9a791 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -138,6 +138,9 @@ The commit message is formed by the title taken from
the
where the patch begins. Excess whitespace at the end of each
line is automatically stripped.
+If a line starts with a "-- >8 --" mark in the body of the message,
+everything before (and the line itself) will be ignored.
+
The patch is expected to be inline, directly following the
message. Any line that is of the form:
--
Nicolas Sebrecht
^ permalink raw reply related
* Re: [PATCH] remove ARM and Mozilla SHA1 implementations
From: Nicolas Pitre @ 2009-08-24 4:12 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.DEB.1.00.0908180208160.8306@pacific.mpi-cbg.de>
On Tue, 18 Aug 2009, Johannes Schindelin wrote:
> Hi,
>
> On Mon, 17 Aug 2009, Nicolas Pitre wrote:
>
> > They are both slower than the new BLK_SHA1 implementation, so it is
> > pointless to keep them around.
> >
> > Signed-off-by: Nicolas Pitre <nico@cam.org>
> > ---
> >
> > Someone else would need to make the call for the PPC version.
>
> If I don't forget, I can test tomorrow on 2 different 32-bit PPCs and
> possibly one 64-bit PPC.
Did you forget? ;-)
Nicolas
^ permalink raw reply
* [PATCH] fix simple deepening of a repo
From: Nicolas Pitre @ 2009-08-24 4:04 UTC (permalink / raw)
To: Junio C Hamano, Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.LFD.2.00.0908220106470.6044@xanadu.home>
If all refs sent by the remote repo during a fetch are reachable
locally, then no further conversation is performed with the remote. This
check is skipped when the --depth argument is provided to allow the
deepening of a shallow clone which corresponding remote repo has no
changed.
However, some additional filtering was added in commit c29727d5 to
remove those refs which are equal on both sides. If the remote repo has
not changed, then the list of refs to give the remote process becomes
empty and simply attempting to deepen a shallow repo always fails.
Let's stop being smart in that case and simply send the whole list over
when that condition is met. The remote will do the right thing anyways.
Test cases for this issue are also provided.
Signed-off-by: Nicolas Pitre <nico@cam.org>
---
On Sat, 22 Aug 2009, Nicolas Pitre wrote:
> try out:
>
> git clone --depth=1 git://git.kernel.org/pub/scm/git/git
> cd git
> git fetch --depth=2
>
> It then silently fails, except for the return code of 1.
Here's the fix. Problem wasn't in builtin-fetch-pack.c after all.
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index a8c2ca2..18376d6 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -139,6 +139,36 @@ test_expect_success 'fsck in shallow repo' '
)
'
+test_expect_success 'simple fetch in shallow repo' '
+ (
+ cd shallow &&
+ git fetch
+ )
+'
+
+test_expect_success 'no changes expected' '
+ (
+ cd shallow &&
+ git count-objects -v
+ ) > count.shallow.2 &&
+ cmp count.shallow count.shallow.2
+'
+
+test_expect_success 'fetch same depth in shallow repo' '
+ (
+ cd shallow &&
+ git fetch --depth=2
+ )
+'
+
+test_expect_success 'no changes expected' '
+ (
+ cd shallow &&
+ git count-objects -v
+ ) > count.shallow.3 &&
+ cmp count.shallow count.shallow.3
+'
+
test_expect_success 'add two more' '
add B66 $B65 &&
add B67 $B66
@@ -201,4 +231,21 @@ test_expect_success 'pull in shallow repo with missing merge base' '
)
'
+test_expect_success 'additional simple shallow deepenings' '
+ (
+ cd shallow &&
+ git fetch --depth=8 &&
+ git fetch --depth=10 &&
+ git fetch --depth=11
+ )
+'
+
+test_expect_success 'clone shallow object count' '
+ (
+ cd shallow &&
+ git count-objects -v
+ ) > count.shallow &&
+ grep "^count: 52" count.shallow
+'
+
test_done
diff --git a/transport.c b/transport.c
index a8df319..ce91387 100644
--- a/transport.c
+++ b/transport.c
@@ -925,11 +925,12 @@ const struct ref *transport_get_remote_refs(struct transport *transport)
int transport_fetch_refs(struct transport *transport, const struct ref *refs)
{
int rc;
- int nr_heads = 0, nr_alloc = 0;
+ int nr_heads = 0, nr_alloc = 0, nr_refs = 0;
const struct ref **heads = NULL;
const struct ref *rm;
for (rm = refs; rm; rm = rm->next) {
+ nr_refs++;
if (rm->peer_ref &&
!hashcmp(rm->peer_ref->old_sha1, rm->old_sha1))
continue;
@@ -937,6 +938,19 @@ int transport_fetch_refs(struct transport *transport, const struct ref *refs)
heads[nr_heads++] = rm;
}
+ if (!nr_heads) {
+ /*
+ * When deepening of a shallow repository is requested,
+ * then local and remote refs are likely to still be equal.
+ * Just feed them all to the fetch method in that case.
+ * This condition shouldn't be met in a non-deepening fetch
+ * (see builtin-fetch.c:quickfetch()).
+ */
+ heads = xmalloc(nr_refs * sizeof(*heads));
+ for (rm = refs; rm; rm = rm->next)
+ heads[nr_heads++] = rm;
+ }
+
rc = transport->fetch(transport, nr_heads, heads);
free(heads);
return rc;
^ permalink raw reply related
* Re: [PATCH-v2/RFC 3/6] xutils: fix ignore-all-space on incomplete line
From: Thell Fowler @ 2009-08-24 3:26 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Thell Fowler, git, Johannes.Schindelin
In-Reply-To: <7vzl9qtev0.fsf@alter.siamese.dyndns.org>
Junio C Hamano (gitster@pobox.com) wrote on Aug 23, 2009:
> Thell Fowler <git@tbfowler.name> writes:
>
> >> Or we can just move the final else clause up and start the function like
> >> this:
> >>
> >> int i1, i2;
> >>
> >> if (!(flags & XDF_WHITESPACE_FLAGS))
> >> return s1 == s2 && !memcmp(l1, l2, s1);
> >>
> >> i1 = i2 = 0;
> >> if (flags & XDF_IGNORE_WHITESPACE) {
> >> ...
> >>
> >> that would get rid of two unnecessary clearing of variables (i1 and i2,
> >> even though I suspect that the compiler _could_ optimize them out without
> >> such an change), and three flags-bit check in the most common case of not
> >> ignoring any whitespaces.
> >>
> >
> > HA! That's a nifty way to do that with the variables.
>
> My tentative draft to replace the "how about this" patch further reworks
> the loop structure and currently looks like this.
>
> It adds net 15 lines but among that 12 lines are comments, which is not so
> bad.
>
It passed every test I threw at it, although it seemed to be a tad bit
slower than the previous revision on my sample data so I ran the following
command several times for both the previous and current version:
time for i in {1..10}; do ./t4015-diff-whitespace.sh>/dev/null &&
./t4015-diff-trailing-whitespace.sh >/dev/null; done
And these results are fairly average on what I saw:
Previous version:
real 2m32.669s
user 0m44.051s
sys 1m34.702s
Current version:
real 2m56.818s
user 0m47.671s
sys 1m46.723s
--
Thell
^ permalink raw reply
* [RFC/PATCH 1/3] gitweb: improve snapshot error handling
From: Mark Rada @ 2009-08-24 3:09 UTC (permalink / raw)
To: Sam Vilain; +Cc: Mark Rada, Jakub Narebski, Junio C Hamano, git
In-Reply-To: <4A91C74D.1080908@vilain.net>
Ok, this is just a resend of the first patch in my set from
earlier, but with some of the commit message reworded, namely
the subject (as suggested by Sam Vilain).
--
Mark Rada (ferrous26)
marada@uwaterloo.ca
--->8---
In the second block of checks to validate a snapshot request, the last
check is never executed because the second last check is a superset of
the last check.
This change will switch the order of the last two checks, it has the
advantage of giving clients a more specific reason why they cannot get
a snapshot format if the format they have chosen is disabled.
Signed-off-by: Mark Rada <marada@uwaterloo.ca>
---
gitweb/gitweb.perl | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 4a42f61..7068db2 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5174,10 +5174,10 @@ sub git_snapshot {
die_error(400, "Invalid snapshot format parameter");
} elsif (!exists($known_snapshot_formats{$format})) {
die_error(400, "Unknown snapshot format");
- } elsif (!grep($_ eq $format, @snapshot_fmts)) {
- die_error(403, "Unsupported snapshot format");
} elsif ($known_snapshot_formats{$format}{'disabled'}) {
die_error(403, "Snapshot format not allowed");
+ } elsif (!grep($_ eq $format, @snapshot_fmts)) {
+ die_error(403, "Unsupported snapshot format");
}
if (!defined $hash) {
--
1.6.4
^ permalink raw reply related
* Re: What's cooking in git.git (Aug 2009, #04; Sun, 23)
From: Nicolas Pitre @ 2009-08-24 1:26 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v1vn2qb29.fsf@alter.siamese.dyndns.org>
On Sun, 23 Aug 2009, Junio C Hamano wrote:
> * lt/block-sha1 (2009-08-17) 4 commits
> (merged to 'next' on 2009-08-18 at 67a1ce8)
> + remove ARM and Mozilla SHA1 implementations
> + block-sha1: guard gcc extensions with __GNUC__
> + make sure byte swapping is optimal for git
> + block-sha1: make the size member first in the context struct
>
> Finishing touches ;-) There were a few Solaris portability patches
> floated around that I didn't pick up, waiting for them to finalize.
Those would be described better as Solaris _optimization_ patches. The
code is already fully portable as it is, except not necessarily optimal
in some cases.
Nicolas
^ permalink raw reply
* What's cooking in git.git (Aug 2009, #04; Sun, 23)
From: Junio C Hamano @ 2009-08-24 1:01 UTC (permalink / raw)
To: git
Here are the topics that have been cooking. Commits prefixed with '-' are
only in 'pu' while commits prefixed with '+' are in 'next'. The ones
marked with '.' do not appear in any of the integration branches, but I am
still holding onto them.
After the 1.6.5 cycle, the next release will be 1.7.0, and we will push
out the planned "push safety" change. 1.7.0 would be a good time to
introduce "justifiable" changes that are not strictly backward compatible.
During 1.6.5 cycle, 'next' will hold topics meant for 1.6.5 and 1.7.0.
--------------------------------------------------
[Graduated to "master"]
* bc/mailsplit-cr-at-eol (2009-08-04) 4 commits
(merged to 'next' on 2009-08-06 at 6bc7c5c)
+ Allow mailsplit (and hence git-am) to handle mails with CRLF line-endings
+ builtin-mailsplit.c: remove read_line_with_nul() since it is no longer used
+ builtin-mailinfo,builtin-mailsplit: use strbufs
+ strbuf: add new function strbuf_getwholeline()
* gb/apply-ignore-whitespace (2009-08-04) 1 commit
(merged to 'next' on 2009-08-06 at 59e2c86)
+ git apply: option to ignore whitespace differences
* cc/replace (2009-05-27) 14 commits.
(merged to 'next' on 2009-08-02 at b9c4bc0)
+ t6050: check pushing something based on a replaced commit
+ Documentation: add documentation for "git replace"
+ Add git-replace to .gitignore
+ builtin-replace: use "usage_msg_opt" to give better error messages
+ parse-options: add new function "usage_msg_opt"
+ builtin-replace: teach "git replace" to actually replace
+ Add new "git replace" command
+ environment: add global variable to disable replacement
+ mktag: call "check_sha1_signature" with the replacement sha1
+ replace_object: add a test case
+ object: call "check_sha1_signature" with the replacement sha1
+ sha1_file: add a "read_sha1_file_repl" function
+ replace_object: add mechanism to replace objects found in "refs/replace/"
+ refs: add a "for_each_replace_ref" function
* ld/p4 (2009-07-30) 1 commit
(merged to 'next' on 2009-08-14 at 36d310d)
+ git-p4: stream from perforce to speed up clones
* mr/gitweb-xz (2009-08-06) 3 commits
(merged to 'next' on 2009-08-14 at b63b8e6)
+ gitweb: add support for XZ compressed snapshots
+ gitweb: update INSTALL regarding specific snapshot settings
+ gitweb: support to globally disable a snapshot format
* jc/verify-pack-stat (2009-08-07) 1 commit
(merged to 'next' on 2009-08-10 at f80d0e9)
+ verify-pack --stat-only: show histogram without verifying
--------------------------------------------------
[New Topics]
* jc/mailinfo-scissors (2009-08-23) 1 commit
- Teach mailinfo to ignore everything before -- >8 -- mark
* tf/diff-whitespace-incomplete-line (2009-08-23) 2 commits.
- xutils: Fix xdl_recmatch() on incomplete lines
- xutils: Fix hashing an incomplete line with whitespaces at the end
* jc/1.7.0-send-email-no-thread-default (2009-08-22) 1 commit
(merged to 'next' on 2009-08-22 at 5106de8)
+ send-email: make --no-chain-reply-to the default
* lt/approxidate (2009-08-22) 2 commits
- Further 'approxidate' improvements
- Improve on 'approxidate'
* mm/reset-report (2009-08-21) 2 commits
- reset: make the reminder output consistent with "checkout"
- Rename REFRESH_SAY_CHANGED to REFRESH_IN_PORCELAIN.
* wl/insta-mongoose (2009-08-21) 1 commit
- Add support for the Mongoose web server.
--------------------------------------------------
[Stalled]
* sr/gfi-options (2009-08-13) 3 commits
- fast-import: test the new option command
- fast-import: add option command
- fast-import: put option parsing code in seperate functions
What is this used by?
* lt/block-sha1 (2009-08-17) 4 commits
(merged to 'next' on 2009-08-18 at 67a1ce8)
+ remove ARM and Mozilla SHA1 implementations
+ block-sha1: guard gcc extensions with __GNUC__
+ make sure byte swapping is optimal for git
+ block-sha1: make the size member first in the context struct
Finishing touches ;-) There were a few Solaris portability patches
floated around that I didn't pick up, waiting for them to finalize.
* js/stash-dwim (2009-07-27) 1 commit.
(merged to 'next' on 2009-08-16 at 67896c4)
+ Make 'git stash -k' a short form for 'git stash save --keep-index'
(this branch is used by tr/reset-checkout-patch.)
* tr/reset-checkout-patch (2009-08-18) 8 commits.
(merged to 'next' on 2009-08-18 at e465bb3)
+ tests: disable interactive hunk selection tests if perl is not available
(merged to 'next' on 2009-08-16 at 67896c4)
+ DWIM 'git stash save -p' for 'git stash -p'
+ Implement 'git stash save --patch'
+ Implement 'git checkout --patch'
+ Implement 'git reset --patch'
+ builtin-add: refactor the meat of interactive_add()
+ Add a small patch-mode testing library
+ git-apply--interactive: Refactor patch mode code
(this branch uses js/stash-dwim.)
There was a discussion on better DWIMmery for the above two topics to (1)
forbid "git stash save --anything-with-dash" and (2) redirect with any
option "git stash --opt" to "git stash save --opt", to keep it flexible
and safe at the same time. I think it is a sane thing to do, but nothing
has happened lately.
* jn/gitweb-blame (2009-08-06) 3 commits
- gitweb: Create links leading to 'blame_incremental' using JavaScript
- gitweb: Incremental blame (WIP)
- gitweb: Add optional "time to generate page" info in footer
Ajax-y blame WIP
* db/vcs-helper (2009-08-09) 17 commits
- Allow helpers to request marks for fast-import
- Allow helpers to report in "list" command that the ref is unchanged
- Add support for "import" helper command
- transport-helper_init(): fix a memory leak in error path
- Add a config option for remotes to specify a foreign vcs
- Allow programs to not depend on remotes having urls
- Allow fetch to modify refs
- Use a function to determine whether a remote is valid
- Use a clearer style to issue commands to remote helpers
(merged to 'next' on 2009-08-07 at f3533ba)
+ Makefile: install hardlinks for git-remote-<scheme> supported by libcurl if possible
+ Makefile: do not link three copies of git-remote-* programs
+ Makefile: git-http-fetch does not need expat
(merged to 'next' on 2009-08-06 at 15da79d)
+ http-fetch: Fix Makefile dependancies
+ Add transport native helper executables to .gitignore
(merged to 'next' on 2009-08-05 at 33d491e)
+ git-http-fetch: not a builtin
+ Use an external program to implement fetching with curl
+ Add support for external programs for handling native fetches
(this branch is used by jh/cvs-helper.)
There was a discussion that suggests that the use of colon ':' before vcs
helper name needs to be corrected. Nothing happened since.
* je/send-email-no-subject (2009-08-05) 1 commit
- send-email: confirm on empty mail subjects
This seems to break t9001. Near the tip of 'pu' I have a iffy
workaround.
--------------------------------------------------
[Cooking]
* cc/sequencer-rebase-i (2009-08-21) 17 commits.
- rebase -i: use "git sequencer--helper --cherry-pick"
- sequencer: add "--cherry-pick" option to "git sequencer--helper"
- sequencer: add "do_commit()" and related functions
- pick: libify "pick_help_msg()"
- revert: libify pick
- rebase -i: use "git sequencer--helper --fast-forward"
- sequencer: let "git sequencer--helper" callers set "allow_dirty"
- sequencer: add "--fast-forward" option to "git sequencer--helper"
- sequencer: add "do_fast_forward()" to perform a fast forward
- rebase -i: use "git sequencer--helper --reset-hard"
- sequencer: add "--reset-hard" option to "git sequencer--helper"
- sequencer: add comments about reset_almost_hard()
- sequencer: add "reset_almost_hard()" and related functions
- rebase -i: use "git sequencer--helper --make-patch"
- sequencer: free memory used in "make_patch" function
- sequencer: add "make_patch" function to save a patch
- sequencer: add "builtin-sequencer--helper.c"
Migrating "rebase -i" bit by bit to C. I am inclined to agree with Dscho
that maybe this approach forces the migration to follow the structure of
the shell script too much, and could force a suboptimal end result, but
we'll see.
* aj/fix-read-tree-from-scratch (2009-08-17) 1 commit
(merged to 'next' on 2009-08-20 at 7a04133)
+ read-tree: Fix regression with creation of a new index file.
Will merge.
* as/maint-graph-interesting-fix (2009-08-18) 1 commit.
- graph API: fix bug in graph_is_interesting()
I need to queue the associated test after getting it signed-off.
* jc/1.7.0-status (2009-08-15) 3 commits
(merged to 'next' on 2009-08-22 at b3507bb)
+ git status: not "commit --dry-run" anymore
+ git stat -s: short status output
+ git stat: the beginning of "status that is not a dry-run of commit"
(this branch uses jc/shortstatus.)
As promised, I squashed incremental "fix-up" into the commits they fix;
this will be kept in 'next' until 1.7.0
* jc/shortstatus (2009-08-15) 11 commits
(merged to 'next' on 2009-08-15 at 7e40766)
+ git commit --dry-run -v: show diff in color when asked
+ Documentation/git-commit.txt: describe --dry-run
(merged to 'next' on 2009-08-12 at 53bda17)
+ wt-status: collect untracked files in a separate "collect" phase
+ Make git_status_config() file scope static to builtin-commit.c
+ wt-status: move wt_status_colors[] into wt_status structure
+ wt-status: move many global settings to wt_status structure
+ commit: --dry-run
(merged to 'next' on 2009-08-06 at fe8cb94)
+ status: show worktree status of conflicted paths separately
+ wt-status.c: rework the way changes to the index and work tree are summarized
+ diff-index: keep the original index intact
+ diff-index: report unmerged new entries
(this branch is used by jc/1.7.0-status.)
Will cook for a bit more and then merge.
* jc/maint-checkout-index-to-prefix (2009-08-16) 1 commit
(merged to 'next' on 2009-08-20 at 2f6aea2)
+ check_path(): allow symlinked directories to checkout-index --prefix
Will merge.
* jc/maint-unpack-objects-strict (2009-08-13) 1 commit.
(merged to 'next' on 2009-08-23 at 38eb750)
+ Fix "unpack-objects --strict"
* jh/submodule-foreach (2009-08-20) 9 commits
(merged to 'next' on 2009-08-20 at 671bea4)
+ git clone: Add --recursive to automatically checkout (nested) submodules
+ t7407: Use 'rev-parse --short' rather than bash's substring expansion notation
(merged to 'next' on 2009-08-18 at f4a881d)
+ git submodule status: Add --recursive to recurse into nested submodules
+ git submodule update: Introduce --recursive to update nested submodules
+ git submodule foreach: Add --recursive to recurse into nested submodules
+ git submodule foreach: test access to submodule name as '$name'
+ Add selftest for 'git submodule foreach'
+ git submodule: Cleanup usage string and add option parsing to cmd_foreach()
+ git submodule foreach: Provide access to submodule name, as '$name'
* jl/submodule-summary-diff-files (2009-08-15) 2 commits
(merged to 'next' on 2009-08-15 at 165bd8e)
+ Documentaqtion/git-submodule.txt: Typofix
(merged to 'next' on 2009-08-14 at a702e78)
+ git submodule summary: add --files option
Will merge.
* lh/short-decorate (2009-08-15) 1 commit
(merged to 'next' on 2009-08-18 at b8c1d96)
+ git-log: allow --decorate[=short|full]
Will merge.
* oa/stash-na (2009-08-11) 1 commit
(merged to 'next' on 2009-08-14 at 12c2e2b)
+ git stash: Give friendlier errors when there is nothing to apply
Will merge.
* jh/notes (2009-07-29) 8 commits.
- t3302-notes-index-expensive: Speed up create_repo()
- fast-import: Add support for importing commit notes
- First draft of notes tree parser with support for fanout subtrees
- Teach "-m <msg>" and "-F <file>" to "git notes edit"
- Add an expensive test for git-notes
- Speed up git notes lookup
- Add a script to edit/inspect notes
- Introduce commit notes
The cvs-helper series depends on this one.
* ne/rev-cache (2009-08-21) 6 commits
. support for path name caching in rev-cache
. full integration of rev-cache into git, completed test suite
. administrative functions for rev-cache, start of integration into git
. support for non-commit object caching in rev-cache
. basic revision cache system, no integration or features
. man page and technical discussion for rev-cache
Updated but seems to break tests when merged to 'pu'; didn't look at the
issue deeply.
* jh/cvs-helper (2009-08-18) 7 commits
- More fixes to the git-remote-cvs installation procedure
- Fix the Makefile-generated path to the git_remote_cvs package in git-remote-cvs
- Add simple selftests of git-remote-cvs functionality
- git-remote-cvs: Remote helper program for CVS repositories
- 2/2: Add Python support library for CVS remote helper
- 1/2: Add Python support library for CVS remote helper
- Basic build infrastructure for Python scripts
(this branch uses db/vcs-helper.)
Builds on db/vcs-helper. The testing of Python part seemed to be
still fragile even with the latest fix on one of my boches with an
earlier round already installed, but I didn't look very deeply before
removing the older installation.
* nd/sparse (2009-08-20) 20 commits
- sparse checkout: inhibit empty worktree
- Add tests for sparse checkout
- read-tree: add --no-sparse-checkout to disable sparse checkout support
- unpack-trees(): ignore worktree check outside checkout area
- unpack_trees(): apply $GIT_DIR/info/sparse-checkout to the final index
- unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-checkout
- unpack-trees.c: generalize verify_* functions
- unpack-trees(): add CE_WT_REMOVE to remove on worktree alone
- Introduce "sparse checkout"
- dir.c: export excluded_1() and add_excludes_from_file_1()
- excluded_1(): support exclude files in index
- unpack-trees(): carry skip-worktree bit over in merged_entry()
- Read .gitignore from index if it is skip-worktree
- Avoid writing to buffer in add_excludes_from_file_1()
- Teach Git to respect skip-worktree bit (writing part)
- Teach Git to respect skip-worktree bit (reading part)
- Introduce "skip-worktree" bit in index, teach Git to get/set this bit
- Add test-index-version
- update-index: refactor mark_valid() in preparation for new options
(merged to 'next' on 2009-08-20 at ea167d7)
+ Prevent diff machinery from examining assume-unchanged entries on worktree
The first one was an independent fix; the rest has been replaced with the
"return of no-checkout" series.
* jc/1.7.0-diff-whitespace-only-status (2009-05-23) 2 commits.
(merged to 'next' on 2009-08-02 at 9c08420)
+ diff: Rename QUIET internal option to QUICK
+ diff: change semantics of "ignore whitespace" options
For 1.7.0. This changes exit code from "git diff --ignore-whitespace" and
friends when there is no actual output. It is a backward incompatible
change, but we could argue that it is a bugfix.
* jc/1.7.0-push-safety (2009-02-09) 2 commits
(merged to 'next' on 2009-08-02 at 38b82fe)
+ Refuse deleting the current branch via push
+ Refuse updating the current branch in a non-bare repository via push
For 1.7.0.
* jc/log-tz (2009-03-03) 1 commit.
- Allow --date=local --date=other-format to work as expected
* jc/mailinfo-remove-brackets (2009-07-15) 1 commit.
- mailinfo: -b option keeps [bracketed] strings that is not a [PATCH] marker
--------------------------------------------------
[I have been too busy to purge these]
* ar/maint-1.6.2-merge-recursive-d-f (2009-05-11) 2 commits.
. Fix for a merge where a branch has an F->D transition
. Add a reminder test case for a merge with F/D transition
* jc/merge-convert (2009-01-26) 1 commit.
. git-merge-file: allow converting the results for the work tree
* lt/read-directory (2009-05-15) 3 commits.
. Add initial support for pathname conversion to UTF-8
. read_directory(): infrastructure for pathname character set conversion
. Add 'fill_directory()' helper function for directory traversal
* ps/blame (2009-03-12) 1 commit.
. blame.c: start libifying the blame infrastructure
* pb/tracking (2009-07-16) 7 commits.
. branch.c: if remote is not config'd for branch, don't try delete push config
. branch, checkout: introduce autosetuppush
. move deletion of merge configuration to branch.c
. remote: add per-remote autosetupmerge and autosetuprebase configuration
. introduce a struct tracking_config
. branch: install_branch_config and struct tracking refactoring
. config: allow false and true values for branch.autosetuprebase
Has been ejected from 'pu' for some time, expecting a reroll.
^ permalink raw reply
* Re: git-mail-commits (Re:What's a good setup for submitting patches to the list properly?)
From: Nicolas Sebrecht @ 2009-08-23 23:41 UTC (permalink / raw)
To: Julian Phillips; +Cc: Christian Couder, Nicolas Sebrecht, Thell Fowler, git
In-Reply-To: <alpine.LNX.2.00.0908232357590.15613@reaper.quantumfyre.co.uk>
The 24/08/09, Julian Phillips wrote:
> On Sun, 23 Aug 2009, Christian Couder wrote:
>
> Using the awsome power of git I have managed to extract it from my random
> tools private repo to here as if I had written it to be a separate entity
> from the start:
>
> git://git.q42.co.uk/mail_commits.git
> (gitweb: http://git.q42.co.uk/w/mail_commits.git)
Thanks a lot.
> If it would be considered useful, then I can also create a patch to add
> it to contrib
I think it worth. That said, I would first add some config options like
mail-commits.cc (not reviewed that much yet) to be a bit more consistent
with the send-email program. I would also add README and INSTALL files.
Could you please consider to place your code under GPLv2?
--
Nicolas Sebrecht
^ permalink raw reply
* Re: git-mail-commits (Re: What's a good setup for submitting patches to the list properly?)
From: Julian Phillips @ 2009-08-23 23:05 UTC (permalink / raw)
To: Christian Couder; +Cc: Nicolas Sebrecht, Thell Fowler, git
In-Reply-To: <200908230911.07218.chriscool@tuxfamily.org>
On Sun, 23 Aug 2009, Christian Couder wrote:
> On Saturday 22 August 2009, Nicolas Sebrecht wrote:
>> The 22/08/09, Christian Couder wrote:
>>> There is "git send-email" that is bundled with git. But I use
>>> git-mail-commits from Julian Philips. I am very happy with it. Thanks
>>> Julian!
>>
>> Isn't there any public repo for it?
>
> Not that I know of, but I think it would be a good idea to publish it
> (perhaps in contrib/).
>
> Julian?
Using the awsome power of git I have managed to extract it from my random
tools private repo to here as if I had written it to be a separate entity
from the start:
git://git.q42.co.uk/mail_commits.git
(gitweb: http://git.q42.co.uk/w/mail_commits.git)
If it would be considered useful, then I can also create a patch to add it
to contrib (there is a master branch in the above repo where I have
subtree merged it in already - though that was more to experiment with
doing subtree merging)
--
Julian
---
The means-and-ends moralists, or non-doers, always end up on their ends
without any means.
-- Saul Alinsky
^ permalink raw reply
* Re: [RFC/PATCH 1/3] gitweb: make suspenders more useful
From: Sam Vilain @ 2009-08-23 22:48 UTC (permalink / raw)
To: Mark Rada; +Cc: Jakub Narebski, Junio C Hamano, git
In-Reply-To: <4A91C512.7000707@mailservices.uwaterloo.ca>
Mark Rada wrote:
>>> Subject: [RFC/PATCH 1/3] gitweb: make suspenders more useful
>>>
>> Suspenders? Really?
>>
> Context:
>
> On 21/08/09 5:43 PM, Junio C Hamano wrote:
>
>> I do not mind keeping these two lines as belt-and-suspender, though.
>>
> Yup...I couldn't think of an appropriate title and I expect this
> patch to be edited (for another reason) or thrown out anyways.
>
Please don't do that. Use of metaphors makes the code harder to follow,
especially for non-native speakers. In this case you confused me, a
British/NZ native speaker because you only used half of the idiom; so
all I was left with was a word which in the English where I speak refers
to a piece of clothing worn most often by prostitutes and people at the
Rocky Horror Picture Show.
Can I suggest "snapshot error handling" as a more neutral term...
Sam
^ permalink raw reply
* Re: [RFC/PATCH 1/3] gitweb: make suspenders more useful
From: Mark Rada @ 2009-08-23 22:39 UTC (permalink / raw)
To: Sam Vilain; +Cc: Mark Rada, Jakub Narebski, Junio C Hamano, git
In-Reply-To: <4A91BE50.7070103@vilain.net>
On 23/08/09 6:10 PM, Sam Vilain wrote:
> Mark Rada wrote:
>> Subject: [RFC/PATCH 1/3] gitweb: make suspenders more useful
>
> Suspenders? Really?
>
> Sam
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Context:
On 21/08/09 5:43 PM, Junio C Hamano wrote:
> Mark A Rada <marada@uwaterloo.ca> writes:
>
>> Unless I missed a case, the tests show that the extra condition check
>> that was added in the &git_snapshot routine is never actually executed,
>> because a disabled snapshot format is not added to @snapshot_fmts, which
>> is checked first.
>>
>> snippet:
>> 5178 } elsif (!grep($_ eq $format, @snapshot_fmts)) {
>> 5179 die_error(403, "Unsupported snapshot format");
>> 5180 } elsif ($known_snapshot_formats{$format}{'disabled'}) {
>> 5181 die_error(403, "Snapshot format not allowed");
>> 5182 }
>> 5183
>
> True; filter_snapshot_fmts looks at 'disabled' first.
>
> I do not mind keeping these two lines as belt-and-suspender, though.
>
Yup...I couldn't think of an appropriate title and I expect this
patch to be edited (for another reason) or thrown out anyways.
--
Mark A Rada (ferrous26)
marada@uwaterloo.ca
^ permalink raw reply
* Re: Pulling one commit at a time.
From: Junio C Hamano @ 2009-08-23 22:33 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: Nanako Shiraishi, git
In-Reply-To: <20090824060710.6117@nanako3.lavabit.com>
Nanako Shiraishi <nanako3@lavabit.com> writes:
> When your histories look like this:
>
> A your 'master'
> /
> ---X---U---V---W---Y public 'master' (your 'origin')
>
> ... you can fetch first.
>
> git fetch origin
>
> Then look at the history in gitk
>
> gitk master origin
>
> And find the commit you are interested in merging (U in the above
> picture). And merge it.
>
> git merge origin~3
>
> Replace "origin~3" in the example above with whatever commit you want to
> merge the entire history leading to it.
A good description. Thanks, Nana.
Novice readers should notice the careful wording used here. She says
"merge the entire history leading to it" instead of simply "merge the
commit". Merging a commit in git always means merging the entire history
leading to that commit, so they mean the same thing to people who know git
well, but it avoids a misunderstanding that, if you did
$ git merge V
it might apply the effect of only V, ignoring what U did, on top of your
current state A. It doesn't.
A-------M your 'master'
/ /
---X---U---V---W---Y public 'master' (your 'origin')
To create a commit that has only the effect of a single commit, you would
need to cherry-pick it.
$ git cherry-pick V
will give you
A-------V' your 'master'
/
---X---U---V---W---Y public 'master' (your 'origin')
where "git diff A V'" is a moral equivalent of "git diff U V".
^ permalink raw reply
* Re: [PATCH] gitweb: pull ref markes pull out of subject <a> tag
From: Junio C Hamano @ 2009-08-23 22:31 UTC (permalink / raw)
To: Giuseppe Bilotta; +Cc: Jakub Narebski, git, Junio C Hamano
In-Reply-To: <cb7bb73a0908231343k3546682ge05cc4f3c3d83638@mail.gmail.com>
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
> 2009/8/23 Jakub Narebski <jnareb@gmail.com>:
>> For format_subject_html which you are fixing, and which is used by
>> 'shortlog', 'history' and 'tags' views this didn't cause much changes
>> in layout. But the way gitweb uses git_print_header_div in views such
>> as 'tree', 'blob' etc., where the outer (containing) link is made into
>> *block* element[1] by the way of CSS (display: block) makes layout
>> (visualisation) very screwed up in older browser. But I don't expect
>> you to fix that.
>>
>> [1] Originally so the area to click is larger.
>
> Fixing that really needs some kind of ridiculously complex
> workarounds, or a totally different layout. That is actually one of
> the situations where nested links make perfect sense, and it's a real
> pity the standard wouldn't allow them, and that some client actually
> altered the DOM to 'fix' it. But anyway.
>
>> Signoff?
>
> Aaaargh. Is it enough if I put it here:
>
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
I can manage.
Thanks, both.
^ permalink raw reply
* Re: [PATCH-v2/RFC 3/6] xutils: fix ignore-all-space on incomplete line
From: Junio C Hamano @ 2009-08-23 22:30 UTC (permalink / raw)
To: Thell Fowler; +Cc: Nanako Shiraishi, git, Johannes.Schindelin
In-Reply-To: <alpine.DEB.2.00.0908231705200.29625@GWPortableVCS>
Thell Fowler <git@tbfowler.name> writes:
>> > Subject: [PATCH] Teach mailinfo to ignore everything before -- >8 -- mark
> ...
> BTW - I'm happily using this and think it should be in git!
The one I sent out had two bugs. Please discard and replace it with a
newer one I'll be pushing out on 'pu' later today.
^ permalink raw reply
* Re: [PATCH-v2/RFC 3/6] xutils: fix ignore-all-space on incomplete line
From: Thell Fowler @ 2009-08-23 22:13 UTC (permalink / raw)
To: Nanako Shiraishi; +Cc: Junio C Hamano, Thell Fowler, git, Johannes.Schindelin
In-Reply-To: <20090824060708.6117@nanako3.lavabit.com>
Nanako Shiraishi (nanako3@lavabit.com) wrote on Aug 23, 2009:
> Quoting Junio C Hamano <gitster@pobox.com>
>
> > Having said that, I could use something like this.
> >
> > -- >8 -- cut here -- >8 --
> > Subject: [PATCH] Teach mailinfo to ignore everything before -- >8 -- mark
> >
> > This teaches mailinfo the scissors -- >8 -- mark; the command ignores
> > everything before it in the message body.
> >
> > Signed-off-by: Junio C Hamano <gitster@pobox.com>
>
> There are left handed people whose scissors run in the wrong direction.
>
Woohoo! Glad the left handed people aren't being discriminated against.
;)
BTW - I'm happily using this and think it should be in git!
--
Thell
^ permalink raw reply
* Re: [RFC/PATCH 1/3] gitweb: make suspenders more useful
From: Sam Vilain @ 2009-08-23 22:10 UTC (permalink / raw)
To: Mark Rada; +Cc: Jakub Narebski, Junio C Hamano, git
In-Reply-To: <4A91BA66.5050108@mailservices.uwaterloo.ca>
Mark Rada wrote:
> Subject: [RFC/PATCH 1/3] gitweb: make suspenders more useful
Suspenders? Really?
Sam
^ permalink raw reply
* [RFC/PATCH 3/3] gitweb: add test cases for snapshot settings
From: Mark Rada @ 2009-08-23 21:53 UTC (permalink / raw)
To: Jakub Narebski, Junio C Hamano; +Cc: git
This commit adds a new test file (t9501) that is used for gitweb test
cases that parse gitweb output to verify the HTTP status code or
message.
Signed-off-by: Mark Rada <marada@uwaterloo.ca>
---
t/t9501-gitweb-standalone-http-status.sh | 71 ++++++++++++++++++++++++++++++
1 files changed, 71 insertions(+), 0 deletions(-)
create mode 100644 t/t9501-gitweb-standalone-http-status.sh
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
new file mode 100644
index 0000000..c4b0479
--- /dev/null
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# Copyright (c) 2009 Mark Rada
+#
+
+. ./gitweb-lib.sh
+
+# ----------------------------------------------------------------------
+# snapshot settings
+
+test_commit \
+ 'SnapshotTest' \
+ 'i can has snapshot?'
+
+cat >>gitweb_config.perl <<\EOF
+$feature{'snapshot'}{'override'} = 0;
+EOF
+
+test_expect_success \
+ 'snapshots: tgz only default format enabled' \
+ 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&
+ grep "Status: 200 OK" gitweb.output &&
+ gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tbz2" &&
+ grep "403 - Unsupported snapshot format" gitweb.output &&
+ gitweb_run "p=.git;a=snapshot;h=HEAD;sf=txz" &&
+ grep "403 - Snapshot format not allowed" gitweb.output &&
+ gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&
+ grep "403 - Unsupported snapshot format" gitweb.output'
+test_debug 'cat gitweb.output'
+
+
+cat >>gitweb_config.perl <<\EOF
+$feature{'snapshot'}{'default'} = ['tgz','tbz2','txz','zip'];
+EOF
+
+test_expect_success \
+ 'snapshots: all enabled in default, use default disabled value' \
+ 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&
+ grep "Status: 200 OK" gitweb.output &&
+ gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tbz2" &&
+ grep "Status: 200 OK" gitweb.output &&
+ gitweb_run "p=.git;a=snapshot;h=HEAD;sf=txz" &&
+ grep "403 - Snapshot format not allowed" gitweb.output &&
+ gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&
+ grep "Status: 200 OK" gitweb.output'
+test_debug 'cat gitweb.output'
+
+
+cat >>gitweb_config.perl <<\EOF
+$known_snapshot_formats{'zip'}{'disabled'} = 1;
+EOF
+
+test_expect_success \
+ 'snapshots: zip explicitly disabled' \
+ 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&
+ grep "403 - Snapshot format not allowed" gitweb.output'
+test_debug 'cat gitweb.output'
+
+
+cat >>gitweb_config.perl <<\EOF
+$known_snapshot_formats{'tgz'}{'disabled'} = 0;
+EOF
+
+test_expect_success \
+ 'snapshots: tgz explicitly enabled' \
+ 'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&
+ grep "Status: 200 OK" gitweb.output'
+test_debug 'cat gitweb.output'
+
+
+test_done
--
1.6.4
^ permalink raw reply related
* [RFC/PATCH 2/3] gitweb: break test suite into library and tests
From: Mark Rada @ 2009-08-23 21:52 UTC (permalink / raw)
To: Jakub Narebski, Junio C Hamano; +Cc: git
To accommodate additions to the tests cases for gitweb, the preamble
from t9500 is now in its library so that new sets of tests for gitweb
can use the same setup without copying the same code.
Signed-off-by: Mark Rada <marada@uwaterloo.ca>
---
t/gitweb-lib.sh | 79 ++++++++++++++++++++++++++++++++
t/t9500-gitweb-standalone-no-errors.sh | 74 +-----------------------------
2 files changed, 80 insertions(+), 73 deletions(-)
create mode 100644 t/gitweb-lib.sh
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
new file mode 100644
index 0000000..3a60fa5
--- /dev/null
+++ b/t/gitweb-lib.sh
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Jakub Narebski
+#
+
+test_description='gitweb as standalone script (basic tests).
+
+This test runs gitweb (git web interface) as CGI script from
+commandline, and checks that it would not write any errors
+or warnings to log.'
+
+gitweb_init () {
+ safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')"
+ cat >gitweb_config.perl <<EOF
+#!/usr/bin/perl
+
+# gitweb configuration for tests
+
+our \$version = 'current';
+our \$GIT = 'git';
+our \$projectroot = "$safe_pwd";
+our \$project_maxdepth = 8;
+our \$home_link_str = 'projects';
+our \$site_name = '[localhost]';
+our \$site_header = '';
+our \$site_footer = '';
+our \$home_text = 'indextext.html';
+our @stylesheets = ('file:///$TEST_DIRECTORY/../gitweb/gitweb.css');
+our \$logo = 'file:///$TEST_DIRECTORY/../gitweb/git-logo.png';
+our \$favicon = 'file:///$TEST_DIRECTORY/../gitweb/git-favicon.png';
+our \$projects_list = '';
+our \$export_ok = '';
+our \$strict_export = '';
+
+EOF
+
+ cat >.git/description <<EOF
+$0 test repository
+EOF
+}
+
+gitweb_run () {
+ GATEWAY_INTERFACE='CGI/1.1'
+ HTTP_ACCEPT='*/*'
+ REQUEST_METHOD='GET'
+ SCRIPT_NAME="$TEST_DIRECTORY/../gitweb/gitweb.perl"
+ QUERY_STRING=""$1""
+ PATH_INFO=""$2""
+ export GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD \
+ SCRIPT_NAME QUERY_STRING PATH_INFO
+
+ GITWEB_CONFIG=$(pwd)/gitweb_config.perl
+ export GITWEB_CONFIG
+
+ # some of git commands write to STDERR on error, but this is not
+ # written to web server logs, so we are not interested in that:
+ # we are interested only in properly formatted errors/warnings
+ rm -f gitweb.log &&
+ perl -- "$SCRIPT_NAME" \
+ >gitweb.output 2>gitweb.log &&
+ if grep '^[[]' gitweb.log >/dev/null 2>&1; then false; else true; fi
+
+ # gitweb.log is left for debugging
+ # gitweb.output is used to parse http output
+}
+
+. ./test-lib.sh
+
+if ! test_have_prereq PERL; then
+ say 'skipping gitweb tests, perl not available'
+ test_done
+fi
+
+perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
+ say 'skipping gitweb tests, perl version is too old'
+ test_done
+}
+
+gitweb_init
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 6275181..a5b5b26 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -3,79 +3,7 @@
# Copyright (c) 2007 Jakub Narebski
#
-test_description='gitweb as standalone script (basic tests).
-
-This test runs gitweb (git web interface) as CGI script from
-commandline, and checks that it would not write any errors
-or warnings to log.'
-
-gitweb_init () {
- safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')"
- cat >gitweb_config.perl <<EOF
-#!/usr/bin/perl
-
-# gitweb configuration for tests
-
-our \$version = "current";
-our \$GIT = "git";
-our \$projectroot = "$safe_pwd";
-our \$project_maxdepth = 8;
-our \$home_link_str = "projects";
-our \$site_name = "[localhost]";
-our \$site_header = "";
-our \$site_footer = "";
-our \$home_text = "indextext.html";
-our @stylesheets = ("file:///$TEST_DIRECTORY/../gitweb/gitweb.css");
-our \$logo = "file:///$TEST_DIRECTORY/../gitweb/git-logo.png";
-our \$favicon = "file:///$TEST_DIRECTORY/../gitweb/git-favicon.png";
-our \$projects_list = "";
-our \$export_ok = "";
-our \$strict_export = "";
-
-EOF
-
- cat >.git/description <<EOF
-$0 test repository
-EOF
-}
-
-gitweb_run () {
- GATEWAY_INTERFACE="CGI/1.1"
- HTTP_ACCEPT="*/*"
- REQUEST_METHOD="GET"
- SCRIPT_NAME="$TEST_DIRECTORY/../gitweb/gitweb.perl"
- QUERY_STRING=""$1""
- PATH_INFO=""$2""
- export GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD \
- SCRIPT_NAME QUERY_STRING PATH_INFO
-
- GITWEB_CONFIG=$(pwd)/gitweb_config.perl
- export GITWEB_CONFIG
-
- # some of git commands write to STDERR on error, but this is not
- # written to web server logs, so we are not interested in that:
- # we are interested only in properly formatted errors/warnings
- rm -f gitweb.log &&
- perl -- "$SCRIPT_NAME" \
- >/dev/null 2>gitweb.log &&
- if grep "^[[]" gitweb.log >/dev/null 2>&1; then false; else true; fi
-
- # gitweb.log is left for debugging
-}
-
-. ./test-lib.sh
-
-if ! test_have_prereq PERL; then
- say 'skipping gitweb tests, perl not available'
- test_done
-fi
-
-perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
- say 'skipping gitweb tests, perl version is too old'
- test_done
-}
-
-gitweb_init
+. ./gitweb-lib.sh
# ----------------------------------------------------------------------
# no commits (empty, just initialized repository)
--
1.6.4
^ permalink raw reply related
* [RFC/PATCH 1/3] gitweb: make suspenders more useful
From: Mark Rada @ 2009-08-23 21:53 UTC (permalink / raw)
To: Jakub Narebski, Junio C Hamano; +Cc: git
In the first block of checks to validate a snapshot request, the last
check is never executed because the second last check is a superset of
the last check.
This change will switch the order of the last two checks, it has the
advantage of giving clients a more specific reason why they cannot get
a specific snapshot format instead of giving them the more generic
response.
Signed-off-by: Mark Rada <marada@uwaterloo.ca>
---
gitweb/gitweb.perl | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 4a42f61..7068db2 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5174,10 +5174,10 @@ sub git_snapshot {
die_error(400, "Invalid snapshot format parameter");
} elsif (!exists($known_snapshot_formats{$format})) {
die_error(400, "Unknown snapshot format");
- } elsif (!grep($_ eq $format, @snapshot_fmts)) {
- die_error(403, "Unsupported snapshot format");
} elsif ($known_snapshot_formats{$format}{'disabled'}) {
die_error(403, "Snapshot format not allowed");
+ } elsif (!grep($_ eq $format, @snapshot_fmts)) {
+ die_error(403, "Unsupported snapshot format");
}
if (!defined $hash) {
--
Mark A Rada (ferrous26)
marada@uwaterloo.ca
^ permalink raw reply related
* Re: [PATCH] import-tars: Allow per-tar author and commit message.
From: Sam Vilain @ 2009-08-23 21:46 UTC (permalink / raw)
To: Peter Krefting; +Cc: git
In-Reply-To: <20090823203640.B195D189B12@perkele>
Peter Krefting wrote:
> Instead of having each imported tar ball's commit message be "Imported
> from filename.tar", optionally take a commit message from a file
> called "filename.tar.msg".
>
> Instead of having each commit have the same author and committer
> information, optionally read the committer information from a file
> called "filename.tar.committer" and author from a file called
> "filename.tar.author".
>
> Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
> ---
> I used this (albeit based on a slightly earlier verison of the script)
> to generate a better-looking history when importing
> http://git.debian.org/?p=crashmail/jamnntpd.git and
> http://git.debian.org/?p=crashmail/crashmail.git into Git, using
> excerpts from the embedded change history as commit messages.
>
> contrib/fast-import/import-tars.perl | 42 +++++++++++++++++++++++++++++++--
> 1 files changed, 39 insertions(+), 3 deletions(-)
>
> diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
> index 78e40d2..7aad16f 100755
> --- a/contrib/fast-import/import-tars.perl
> +++ b/contrib/fast-import/import-tars.perl
> @@ -109,12 +109,48 @@ foreach my $tar_file (@ARGV)
> $have_top_dir = 0 if $top_dir ne $1;
> }
>
> + # Optionally read a commit message from <filename.tar>.msg
> + my $commit_msg = "Imported from $tar_file.";
> + if (open MSG, '<', "${tar_file}.msg")
> + {
> + $commit_msg = '';
> + while (<MSG>)
> + {
> + $commit_msg .= $_;
> + }
> + close MSG;
> + }
> +
> + # Optionally read a committer from <filename.tar>.committer
> + # (first line is name, second line is e-mail address).
> + my $this_committer_name = $committer_name;
> + my $this_committer_email = $committer_email;
> + if (open COMMITTER, '<', "${tar_file}.committer")
> + {
> + ($this_committer_name, $this_committer_email) = <COMMITTER>;
> + chomp $this_committer_name;
> + chomp $this_committer_email;
> + close COMMITTER;
> + }
> +
> + # Optionally read an author from <filename.tar>.author
> + # (first line is name, second line is e-mail address).
> + my $this_author_name = $author_name;
> + my $this_author_email = $author_email;
> + if (open AUTHOR, '<', "${tar_file}.author")
> + {
> + ($this_author_name, $this_author_email) = <AUTHOR>;
> + chomp $this_author_name;
> + chomp $this_author_email;
> + close AUTHOR;
> + }
> +
>
It's not necessary to duplicate code like that.
Also I wonder if there isn't a nicer interface for users. Why not allow
the file to specify From:, Committer: etc as header lines
# Optionally read a commit message from <filename.tar>.msg
my $commit_msg = "Imported from $tar_file.";
my ($committer, $commit_date, $author, $author_date);
if (open MSG, '<', "${tar_file}.desc")
{
my $state = "header";
$commit_msg = '';
my $last_val;
while (<MSG>)
{
if ($state eq "header") {
if (m{^([A-Z][\w\-]+): (.*)}) {
my ($header, $value) = $1;
$last_val = ($header eq "Date" ? \$author_date :
$header eq "From" ? \$author :
$header eq "Subject" ? \$commit_msg :
$header eq "Commit-Date" ? \$commit_date :
$header eq "Committer" ? \$committer :
undef );
if ($last_val) {
$$last_val = $value;
}
else {
warn "ignoring header '$header' in ${tar_file}.desc line $.\n";
}
}
elsif (m{^\s+(.+)}) {
if ($last_val) {
$$last_val .= " $1";
}
}
elsif (m{^\s*$}) {
$commit_msg .= ($commit_msg ? "\n" : "") . "\n";
$state = "body";
next;
}
}
if ($state eq "body") {
$commit_msg .= $_;
}
}
close MSG;
}
($this_committer_name, $this_committer_email) =
choose_email($committer, $committer_name, $committer_email);
($this_author_name, $this_author_email) =
choose_email($author, $author_name, $author_email);
sub choose_email {
my ($spec_combined, $def_name, $def_email) = @_;
return ($def_name, $def_email) unless $spec_combined;
if ($spec_combined =~ m{^([^<]+) <([^@]+@[^@]+)>$})) {
($1, $2);
}
elsif ($spec_combined =~ m{^([^@]+@[^@]+) \((.*)\)$}) {
($2, $1);
}
else {
warn "Couldn't parse e-mail address '$spec_combined'";
($def_name, $def_email);
}
}
Something like that, anyway...
Sam
> print FI <<EOF;
> commit $branch_ref
> -author $author_name <$author_email> $author_time +0000
> -committer $committer_name <$committer_email> $commit_time +0000
> +author $this_author_name <$this_author_email> $author_time +0000
> +committer $this_committer_name <$this_committer_email> $commit_time +0000
> data <<END_OF_COMMIT_MESSAGE
> -Imported from $tar_file.
> +$commit_msg
> END_OF_COMMIT_MESSAGE
>
> deleteall
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox