Re: [PATCH 1/2] sequencer.c: check for lock failure and bail early in fast_forward_to

2014-04-15 Thread Brandon Casey
On Tue, Apr 15, 2014 at 4:46 PM, Ronnie Sahlberg sahlb...@google.com wrote: snip well-worded commit message Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- sequencer.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/sequencer.c b/sequencer.c index bde5f04..6aa3b50 100644

Re: [PATCH 10/10] pack-revindex: radix-sort the revindex

2013-07-10 Thread Brandon Casey
On Wed, Jul 10, 2013 at 4:55 AM, Jeff King p...@peff.net wrote: The pack revindex stores the offsets of the objects in the pack in sorted order, allowing us to easily find the on-disk size of each object. To compute it, we populate an array with the offsets from the sha1-sorted idx file, and

Re: [PATCHv3 10/10] pack-revindex: radix-sort the revindex

2013-07-11 Thread Brandon Casey
nice. For what it's worth: Reviewed-by: Brandon Casey draf...@gmail.com remainder retained for reference (or whatever Jonathan usually says) The interdiff is: diff --git a/pack-revindex.c b/pack-revindex.c index 9365bc2..b4d2b35 100644 --- a/pack-revindex.c +++ b/pack-revindex.c

[PATCH] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-07-29 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com When the number of open packs exceeds pack_max_fds, unuse_one_window() is called repeatedly to attempt to release the least-recently-used pack windows, which, as a side-effect, will also close a pack file after closing its last open window. If a pack file

Re: [PATCH] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-07-30 Thread Brandon Casey
On Tue, Jul 30, 2013 at 12:52 PM, Jeff King p...@peff.net wrote: On Tue, Jul 30, 2013 at 08:39:48AM -0700, Junio C Hamano wrote: Brandon Casey bca...@nvidia.com writes: From: Brandon Casey draf...@gmail.com When the number of open packs exceeds pack_max_fds, unuse_one_window

[PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-07-31 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com When the number of open packs exceeds pack_max_fds, unuse_one_window() is called repeatedly to attempt to release the least-recently-used pack windows, which, as a side-effect, will also close a pack file after closing its last open window. If a pack file

[PATCH 2/2] Don't close pack fd when free'ing pack windows

2013-07-31 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com Now that close_one_pack() has been introduced to handle file descriptor pressure, it is not strictly necessary to close the pack file descriptor in unuse_one_window() when we're under memory pressure. Jeff King provided a justification for leaving the pack

Re: [PATCH 2/2] Don't close pack fd when free'ing pack windows

2013-07-31 Thread Brandon Casey
On Wed, Jul 31, 2013 at 2:08 PM, Antoine Pelisse apeli...@gmail.com wrote: On Wed, Jul 31, 2013 at 9:51 PM, Brandon Casey bca...@nvidia.com wrote: --- This email message is for the sole use of the intended recipient

Re: [PATCH 2/2] Don't close pack fd when free'ing pack windows

2013-07-31 Thread Brandon Casey
On Wed, Jul 31, 2013 at 2:21 PM, Fredrik Gustafsson iv...@iveqy.com wrote: On Wed, Jul 31, 2013 at 11:08:21PM +0200, Antoine Pelisse wrote: On Wed, Jul 31, 2013 at 9:51 PM, Brandon Casey bca...@nvidia.com wrote

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
On Thu, Aug 1, 2013 at 10:12 AM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey bca...@nvidia.com writes: If the refs are loose, then upload-pack will read each ref from the pack (allocating one or more mmap windows) so it can peel tags and advertise the underlying object. If the refs

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: I've been looking closer at uses of p-windows everywhere, and it seems that we always open_packed_git() before we try to create new windows. There doesn't seem to be any reason

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
On Thu, Aug 1, 2013 at 12:16 PM, Brandon Casey draf...@gmail.com wrote: On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: I've been looking closer at uses of p-windows everywhere, and it seems that we always open_packed_git

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
On Thu, Aug 1, 2013 at 1:02 PM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano gits...@pobox.com wrote: That makes me feel somewhat uneasy. Yes, you can open/mmap/close and hold onto the contents of a file still

[PATCH v3] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
* pack with the least-recently-used windows Signed-off-by: Brandon Casey draf...@gmail.com --- Here's the version that leaves the mmap windows open after closing the pack file descriptor. -Brandon sha1_file.c | 79 - 1 file changed, 78

Re: [regression] Re: git-cat-file --batch reversion; cannot query filenames with spaces

2013-08-02 Thread Brandon Casey
On Fri, Aug 2, 2013 at 8:27 AM, Joey Hess j...@kitenet.net wrote: Jeff King wrote: By the way, Joey, I am not sure how safe git cat-file --batch-check is for arbitrary filenames. In particular, I don't know how it would react to a filename with an embedded newline (and I do not think it will

Re: [PATCH v3] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-02 Thread Brandon Casey
On Fri, Aug 2, 2013 at 9:26 AM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: +/* + * The LRU pack is the one with the oldest MRU window, preferring packs + * with no used windows, or the oldest mtime if it has no windows allocated. + */ +static void

[PATCH 2/3] t9902-completion.sh: old Bash still does not support array+=('') notation

2013-08-21 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com Old Bash (3.0) which is distributed with RHEL 4.X and other ancient platforms that are still in wide use, does not understand the array+=() notation. Let's use an explicit assignment to the new array element which works everywhere, like: array[${#array

[PATCH 1/3] git-completion.bash: use correct Bash/Zsh array length syntax

2013-08-21 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com The syntax for retrieving the number of elements in an array is: ${#name[@]} Signed-off-by: Brandon Casey draf...@gmail.com --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion

[PATCH 3/3] Revert bash prompt: avoid command substitution when finalizing gitstring

2013-08-21 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com This reverts commit 69a8141a5d81925b7e08cb228535e9ea4a7a02e3. Old Bash (3.0) which is distributed with RHEL 4.X and other ancient platforms that are still in wide use, does not have a printf that supports -v. Let's revert this patch and go back to using

Re: [PATCH 3/3] Revert bash prompt: avoid command substitution when finalizing gitstring

2013-08-21 Thread Brandon Casey
On Wed, Aug 21, 2013 at 2:47 PM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey bca...@nvidia.com writes: From: Brandon Casey draf...@gmail.com This reverts commit 69a8141a5d81925b7e08cb228535e9ea4a7a02e3. Old Bash (3.0) which is distributed with RHEL 4.X and other ancient platforms

Re: [PATCH 3/3] Revert bash prompt: avoid command substitution when finalizing gitstring

2013-08-21 Thread Brandon Casey
On Wed, Aug 21, 2013 at 5:22 PM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: On Wed, Aug 21, 2013 at 2:47 PM, Junio C Hamano gits...@pobox.com wrote: # on load... printf -v __git_printf_supports_v -- %s yes /dev/null 21

[PATCH] contrib/git-prompt.sh: handle missing 'printf -v' more gracefully

2013-08-21 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com Old Bash (3.0) which is distributed with RHEL 4.X and other ancient platforms that are still in wide use, do not have a printf that supports -v. Neither does Zsh (which is already handled in the code). As suggested by Junio, let's test whether printf

[PATCH] contrib/git-prompt.sh: handle missing 'printf -v' more gracefully

2013-08-21 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com Old Bash (3.0) which is distributed with RHEL 4.X and other ancient platforms that are still in wide use, do not have a printf that supports -v. Neither does Zsh (which is already handled in the code). As suggested by Junio, let's test whether printf

Re: receive.denyNonNonFastForwards not denying force update

2012-08-20 Thread Brandon Casey
On Mon, Aug 20, 2012 at 6:22 PM, Junio C Hamano gits...@pobox.com wrote: Sitaram Chamarty sitar...@gmail.com writes: On Mon, Aug 20, 2012 at 10:35 PM, Junio C Hamano gits...@pobox.com wrote: John Arthorne arthorne.ecli...@gmail.com writes: For all the details see this bugzilla, particularly

Re: Porting git to HP NonStop

2012-08-22 Thread Brandon Casey
On Wed, Aug 22, 2012 at 9:30 AM, Joachim Schmitz j...@schmitz-digital.de wrote: OK, so how about this: /usr/local/bin/diff -EBbu ./compat/mkdir.c.orig ./compat/mkdir.c --- ./compat/mkdir.c.orig 2012-08-21 05:02:11 -0500 +++ ./compat/mkdir.c2012-08-21 05:02:11 -0500 @@ -0,0 +1,24 @@

Re: Porting git to HP NonStop

2012-08-22 Thread Brandon Casey
On Wed, Aug 22, 2012 at 10:00 AM, Brandon Casey draf...@gmail.com wrote: Also, we have xstrndup. So I think the body of your function can become something like: if (len dir[len-1] == '/') dir = tmp_dir = xstrndup(dir, len-1); retval = mkdir(dir, mode); free(tmp_dir

Re: Porting git to HP NonStop

2012-08-22 Thread Brandon Casey
On Wed, Aug 22, 2012 at 10:18 AM, Joachim Schmitz j...@schmitz-digital.de wrote: From: Brandon Casey [mailto:draf...@gmail.com] Sent: Wednesday, August 22, 2012 7:01 PM To: Joachim Schmitz Cc: Junio C Hamano; Shawn Pearce; git@vger.kernel.org; rsbec...@nexbridge.com Subject: Re: Porting git

Re: Porting git to HP NonStop

2012-08-22 Thread Brandon Casey
On Wed, Aug 22, 2012 at 10:41 AM, Johannes Sixt j...@kdbg.org wrote: Am 22.08.2012 19:00, schrieb Brandon Casey: So I think the body of [compat_mkdir] can become something like: if (len dir[len-1] == '/') dir = tmp_dir = xstrndup(dir, len-1); Don't use x* wrappers in the compat

Re: Porting git to HP NonStop

2012-08-22 Thread Brandon Casey
On Wed, Aug 22, 2012 at 11:09 AM, Brandon Casey draf...@gmail.com wrote: On Wed, Aug 22, 2012 at 10:41 AM, Johannes Sixt j...@kdbg.org wrote: Don't use x* wrappers in the compat layer, at least not those that allocate memory: They behave unpredictably due to try_to_free_routine and may lead

Re: Porting git to HP NonStop

2012-08-22 Thread Brandon Casey
On Wed, Aug 22, 2012 at 11:33 AM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: Perhaps something like: diff --git a/usage.c b/usage.c index a2a6678..2d0ff35 100644 --- a/usage.c +++ b/usage.c @@ -80,8 +80,15 @@ void NORETURN usage(const char *err

Re: Is git mktag supposed to accept git cat-file input?

2012-10-24 Thread Brandon Casey
On Wed, Oct 24, 2012 at 4:39 PM, Anand Kumria akum...@acm.org wrote: Hi, I am doing some experimenting with git-mktag, and was looking into the format it expects on input. Should this sequence of commands work? Yes, with a slight tweak... kalki:[/tmp/gittest]% git tag -m tag-test tag-test

Re: signing commits with openssl/PKCS#11

2012-10-25 Thread Brandon Casey
On Mon, Oct 22, 2012 at 6:38 AM, Mat Arge argemat1...@gmail.com wrote: Hy! I would like to sign each commit with a X.509 certificate and a private key stored on a PKCS#11 token. I assume that that should be possible somehow using a hook which calls openssl. Does somebody know a working

Re: [PATCH] Documentation/CommunityGuidelines

2013-06-11 Thread Brandon Casey
On Tue, Jun 11, 2013 at 7:40 AM, Michael Haggerty mhag...@alum.mit.edu wrote: At the risk of being presumptuous myself, I suggest that you show a copy of your email to somebody whom you know and respect in the real world, somebody who is not immersed in the Git community meltdown. For

[PATCH 1/2] builtin/checkout.c: don't leak memory in check_tracking_name

2013-06-17 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com remote_find_tracking() populates the query struct with an allocated string in the dst member. So, we do not need to xstrdup() the string, since we can transfer ownership from the query struct (which will go out of scope at the end of this function) to our

[PATCH 2/2] t/t9802: explicitly name the upstream branch to use as a base

2013-06-17 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com Prior to commit fa83a33b, the 'git checkout' DWIMery would create a new local branch if the specified branch name did not exist and it matched exactly one ref in the remotes namespace. It searched the remotes namespace for matching refs using a simple

[PATCH] http.c: don't rewrite the user:passwd string multiple times

2013-06-17 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com Curl requires that we manage any strings that we pass to it as pointers. So, we should not be overwriting this strbuf after we've passed it to curl. Additionally, it is unnecessary since we only prompt for the user name and password once, so we end up

Re: [PATCH] http.c: don't rewrite the user:passwd string multiple times

2013-06-18 Thread Brandon Casey
On Mon, Jun 17, 2013 at 10:19 PM, Jeff King p...@peff.net wrote: On Mon, Jun 17, 2013 at 07:00:40PM -0700, Brandon Casey wrote: Curl requires that we manage any strings that we pass to it as pointers. So, we should not be overwriting this strbuf after we've passed it to curl. My

[PATCH v2] http.c: don't rewrite the user:passwd string multiple times

2013-06-18 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com Curl older than 7.17 (RHEL 4.X provides 7.12 and RHEL 5.X provides 7.15) requires that we manage any strings that we pass to it as pointers. So, we really shouldn't be modifying this strbuf after we have passed it to curl. Our interaction with curl

Re: How to still kill git fetch with too many refs

2013-07-02 Thread Brandon Casey
On Mon, Jul 1, 2013 at 10:01 PM, Jeff King p...@peff.net wrote: On Tue, Jul 02, 2013 at 12:41:51AM -0400, Jeff King wrote: I replicated your test setup, and the problem is that we have many common objects on both sides during the ref negotiation. So we end up in rev_list_push for each one,

[PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-02 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com When pushing, each ref in the local repository must be paired with a ref advertised by the remote server. Currently, this is performed by first applying the refspec to the local ref to transform the local ref into the name of the remote ref

Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-03 Thread Brandon Casey
On Tue, Jul 2, 2013 at 11:23 PM, Jeff King p...@peff.net wrote: On Tue, Jul 02, 2013 at 04:53:48PM -0700, Brandon Casey wrote: From: Brandon Casey draf...@gmail.com When pushing, each ref in the local repository must be paired with a ref advertised by the remote server. Currently

Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-03 Thread Brandon Casey
On 7/3/2013 11:40 AM, Junio C Hamano wrote: Brandon Casey draf...@gmail.com writes: Right. For repos with few refs on either side, I don't think there will be any measurable difference. When pushing a single ref to a repo with a very large number of refs, we will see a very small net loss

Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-03 Thread Brandon Casey
On 7/3/2013 12:00 PM, Jeff King wrote: On Wed, Jul 03, 2013 at 11:40:12AM -0700, Junio C Hamano wrote: Brandon Casey draf...@gmail.com writes: Right. For repos with few refs on either side, I don't think there will be any measurable difference. When pushing a single ref to a repo

[PATCH v2] remote.c: avoid O(m*n) behavior in match_push_refs

2013-07-08 Thread Brandon Casey
of local refs), so the overhead of creating the search index would likely exceed the benefit of using it. Signed-off-by: Brandon Casey draf...@gmail.com --- Here is the reroll with an updated commit message that hopefully provides a little more detail to justify this change. I removed the use

[PATCH v2 w/prune index] remote.c: avoid O(m*n) behavior in match_push_refs

2013-07-08 Thread Brandon Casey
. A similar operation is performed in the reverse direction when pruning using a matching or pattern refspec. Let's avoid O(m*n) behavior in the same way by lazily preparing an index on the local refs. Signed-off-by: Brandon Casey draf...@gmail.com --- On Mon, Jul 8, 2013 at 12:50 AM, Jeff King p

Re: [PATCH 4/4] pack-revindex: radix-sort the revindex

2013-07-08 Thread Brandon Casey
On Sun, Jul 7, 2013 at 3:14 AM, Jeff King p...@peff.net wrote: The pack revindex stores the offsets of the objects in the pack in sorted order, allowing us to easily find the on-disk size of each object. To compute it, we populate an array with the offsets from the sha1-sorted idx file, and

Re: [PATCH 4/4] pack-revindex: radix-sort the revindex

2013-07-08 Thread Brandon Casey
On Mon, Jul 8, 2013 at 1:50 PM, Brandon Casey draf...@gmail.com wrote: On Sun, Jul 7, 2013 at 3:14 AM, Jeff King p...@peff.net wrote: diff --git a/pack-revindex.c b/pack-revindex.c index 77a0465..d2adf36 100644 --- a/pack-revindex.c +++ b/pack-revindex.c @@ -59,11 +59,78 @@ static int

[PATCH 1/5] t/test-lib-functions.sh: allow to specify the tag name to test_commit

2012-11-14 Thread Brandon Casey
The message part of test_commit() may not be appropriate for a tag name. So let's allow test_commit to accept a fourth argument to specify the tag name. Signed-off-by: Brandon Casey bca...@nvidia.com --- t/test-lib-functions.sh | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff

[PATCH 2/5] t/t3511: demonstrate breakage in cherry-pick -s

2012-11-14 Thread Brandon Casey
not Signed-off-by: A.U. Thor aut...@example.com (cherry picked from da39a3ee5e6b4b0d3255bfef95601890afd80709) Signed-off-by: C O Mmitter commit...@example.com Signed-off-by: Brandon Casey bca...@nvidia.com --- t/t3511-cherry-pick-x.sh | 77

[PATCH 4/5] sequencer.c: recognize (cherry picked from ... as part of s-o-b footer

2012-11-14 Thread Brandon Casey
the (cherry picked from ... string as part of the footer. Plus mark the test in t3511 as fixed. Signed-off-by: Brandon Casey bca...@nvidia.com --- sequencer.c | 44 +--- t/t3511-cherry-pick-x.sh | 2 +- 2 files changed, 30 insertions(+), 16

[PATCH/RFC 5/5] sequencer.c: always separate (cherry picked from from commit body

2012-11-14 Thread Brandon Casey
Start treating the (cherry picked from line added by cherry-pick -x the same way that the s-o-b lines are treated. Namely, separate them from the main commit message body with an empty line. Also, introduce tests to test this functionality. Signed-off-by: Brandon Casey bca...@nvidia.com

[PATCH 3/5] sequencer.c: handle rfc2822 continuation lines correctly

2012-11-14 Thread Brandon Casey
ends_rfc2822_footer() was incorrectly checking whether the current line was a continuation of the previous line. It was actually checking the next line instead of the current line. Let's fix this and mark the test as expect_success. Signed-off-by: Brandon Casey bca...@nvidia.com

Re: [PATCH 1/5] t/test-lib-functions.sh: allow to specify the tag name to test_commit

2012-11-14 Thread Brandon Casey
Good eye. Thanks. On Wed, Nov 14, 2012 at 7:20 PM, Matt Kraai kr...@ftbfs.org wrote: On Wed, Nov 14, 2012 at 05:37:50PM -0800, Brandon Casey wrote: -# Both file and contents default to message. +# Both file contents and tag default to message. I think this line would be better as # file

[PATCH 1/5 v2] t/test-lib-functions.sh: allow to specify the tag name to test_commit

2012-11-14 Thread Brandon Casey
The message part of test_commit() may not be appropriate for a tag name. So let's allow test_commit to accept a fourth argument to specify the tag name. Signed-off-by: Brandon Casey bca...@nvidia.com --- t/test-lib-functions.sh | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff

[PATCH v2 4/5] sequencer.c: recognize (cherry picked from ... as part of s-o-b footer

2012-11-15 Thread Brandon Casey
the (cherry picked from ... string as part of the footer. Plus mark the test in t3511 as fixed. Signed-off-by: Brandon Casey bca...@nvidia.com --- Declare cherry_picked_prefix variable as static. This is the only change with respect to v1. -Brandon sequencer.c | 44

Re: [PATCH] Unify appending signoff in format-patch, commit and sequencer

2012-11-15 Thread Brandon Casey
On Thu, Nov 15, 2012 at 4:32 AM, Nguyễn Thái Ngọc Duy pclo...@gmail.com wrote: There are two implementations of append_signoff in log-tree.c and sequencer.c, which do more or less the same thing. This patch - teaches sequencer.c's append_signoff() not to append the signoff if it's already

[PATCH 6/5] sequencer.c: refrain from adding duplicate s-o-b lines

2012-11-15 Thread Brandon Casey
Detect whether the s-o-b already exists in the commit footer and refrain from adding a duplicate. Update t3511 to test new behavior. Signed-off-by: Brandon Casey bca...@nvidia.com --- Hi Duy, How about this patch on top of my series as a base for your patch to unify the code paths that append

Re: [PATCH 2/5] t/t3511: demonstrate breakage in cherry-pick -s

2012-11-15 Thread Brandon Casey
On Thu, Nov 15, 2012 at 5:58 PM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: The cherry-pick -s functionality is currently broken in two ways. 1. handling of rfc2822 continuation lines has a bug, and the continuation lines are not handled

Re: [PATCH 6/5] sequencer.c: refrain from adding duplicate s-o-b lines

2012-11-16 Thread Brandon Casey
On Thu, Nov 15, 2012 at 6:03 PM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: Detect whether the s-o-b already exists in the commit footer and refrain from adding a duplicate. If you are trying to forbid git cherry-pick -s $other from adding s-o

[PATCH 01/11] sequencer.c: remove broken support for rfc2822 continuation in footer

2012-11-25 Thread Brandon Casey
line. Since a commit message is not governed by the line length limits imposed by rfc2822 for email messages, and it does not seem like this functionality would produce better commit messages anyway, let's remove this broken functionality. Signed-off-by: Brandon Casey bca...@nvidia.com

[PATCH 02/11] t/test-lib-functions.sh: allow to specify the tag name to test_commit

2012-11-25 Thread Brandon Casey
The message part of test_commit() may not be appropriate for a tag name. So let's allow test_commit to accept a fourth argument to specify the tag name. Signed-off-by: Brandon Casey bca...@nvidia.com --- t/test-lib-functions.sh | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff

[PATCH 03/11] t/t3511: add some tests of 'cherry-pick -s' functionality

2012-11-25 Thread Brandon Casey
footer containing a mix of s-o-b like elements and s-o-b elements. (marked expect failure) Signed-off-by: Brandon Casey bca...@nvidia.com --- t/t3511-cherry-pick-x.sh | 111 +++ 1 file changed, 111 insertions(+) create mode 100755 t/t3511-cherry-pick

[PATCH 04/11] sequencer.c: recognize (cherry picked from ... as part of s-o-b footer

2012-11-25 Thread Brandon Casey
...@example.com (cherry picked from da39a3ee5e6b4b0d3255bfef95601890afd80709) Signed-off-by: C O Mitter commit...@example.com Signed-off-by: Brandon Casey bca...@nvidia.com --- sequencer.c | 42 t/t3511-cherry-pick-x.sh | 55

[PATCH 05/11] sequencer.c: always separate (cherry picked from from commit body

2012-11-25 Thread Brandon Casey
Start treating the (cherry picked from line added by cherry-pick -x the same way that the s-o-b lines are treated. Namely, separate them from the main commit message body with an empty line. Introduce tests to test this functionality. Signed-off-by: Brandon Casey bca...@nvidia.com

[PATCH 06/11] sequencer.c: teach append_signoff how to detect duplicate s-o-b

2012-11-25 Thread Brandon Casey
Teach append_signoff how to detect a duplicate s-o-b in the commit footer. This is in preparation to unify the append_signoff implementations in log-tree.c and sequencer.c. Fixes test in t3511. Signed-off-by: Brandon Casey bca...@nvidia.com --- builtin/commit.c | 2 +- sequencer.c

[PATCH 07/11] sequencer.c: teach append_signoff to avoid adding a duplicate newline

2012-11-25 Thread Brandon Casey
. A following patch will make format-patch use this function rather than the append_signoff implementation inside log-tree.c. Signed-off-by: Brandon Casey bca...@nvidia.com --- sequencer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sequencer.c b/sequencer.c index

[PATCH 08/11] t4014: more tests about appending s-o-b lines

2012-11-25 Thread Brandon Casey
From: Nguyễn Thái Ngọc Duy pclo...@gmail.com [bc: fix test 90 signoff: some random signoff-alike and mark as failing. Correct behavior should insert a blank line after message body and signed-off-by ] Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Brandon Casey

[PATCH 09/11] format-patch: stricter S-o-b detection

2012-11-25 Thread Brandon Casey
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Brandon Casey bca...@nvidia.com --- log-tree.c | 37 +-- t/t4014-format-patch.sh | 95 + 2 files changed, 130 insertions(+), 2 deletions(-) diff --git a/log

[PATCH 10/11] format-patch: update append_signoff prototype

2012-11-25 Thread Brandon Casey
From: Nguyễn Thái Ngọc Duy pclo...@gmail.com This is a preparation step for merging with append_signoff from sequencer.c Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Brandon Casey bca...@nvidia.com --- builtin/log.c | 13 + log-tree.c| 21

[PATCH 11/11] Unify appending signoff in format-patch, commit and sequencer

2012-11-25 Thread Brandon Casey
tests fixed as appropriate. [Commit message mostly stolen from Nguyễn Thái Ngọc Duy's original unification patch] Signed-off-by: Brandon Casey bca...@nvidia.com --- log-tree.c | 122 +--- t/t4014-format-patch.sh | 27 +-- 2 files

Re: [PATCH] Documentation/git-push.txt: fix typo in remote tracking branch path

2012-11-26 Thread Brandon Casey
On 11/26/2012 5:30 PM, Junio C Hamano wrote: Brandon Casey bca...@nvidia.com writes: From: Brandon Casey draf...@gmail.com This example in the documentation seems to be trying to describe the likely remote tracking branch that will be updated by a push to the origin remote

Re: [PATCH 04/11] sequencer.c: recognize (cherry picked from ... as part of s-o-b footer

2012-11-28 Thread Brandon Casey
On 11/28/2012 4:02 PM, Junio C Hamano wrote: Brandon Casey draf...@gmail.com writes: -static int ends_rfc2822_footer(struct strbuf *sb, int ignore_footer) +static int is_rfc2822_line(const char *buf, int len) +{ + int i; + + for (i = 0; i len; i++) { + int ch = buf[i

Re: [PATCH v2 1/4] t4014: more tests about appending s-o-b lines

2012-12-02 Thread Brandon Casey
On Sat, Dec 1, 2012 at 11:06 PM, Torsten Bögershausen tbo...@web.de wrote: On 22.11.12 17:38, Nguyễn Thái Ngọc Duy wrote: Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- t/t4014-format-patch.sh | 145 1 file changed, 145

Re: [PATCH 3/4] t4014: do not uese echo -n

2013-01-02 Thread Brandon Casey
On Tue, Jan 1, 2013 at 5:16 PM, Junio C Hamano gits...@pobox.com wrote: Torsten Bögershausen tbo...@web.de writes: echo -n is not portable on all systems. Use printf instead Signed-off-by: Torsten Bögershausen tbo...@web.de --- Brandon, this comes from 932581b (Unify appending signoff in

Re: git filter-branch doesn't dereference annotated tags

2013-01-03 Thread Brandon Casey
On Thu, Jan 3, 2013 at 2:33 AM, Johannes Sixt j...@kdbg.org wrote: Am 03.01.2013 10:50, schrieb Grégory Pakosz: IOW, if the command was something like git filter-branch ...filter options... -- v1.0 master ... and v1.0 is an annotated tag, then it is reasonable to expect v1.0 to be

[PATCH] git-completion.bash: replace zsh notation that breaks bash 3.X

2013-01-18 Thread Brandon Casey
from loading the completion script and breaks test 9902. We can easily work around this by using standard Bash array notation. Signed-off-by: Brandon Casey draf...@gmail.com --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib

Re: [PATCH] git-completion.bash: replace zsh notation that breaks bash 3.X

2013-01-18 Thread Brandon Casey
On Fri, Jan 18, 2013 at 11:08 AM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: On Fri, Jan 18, 2013 at 7:02 AM, Andreas Schwab sch...@linux-m68k.org wrote: Brandon Casey draf...@gmail.com writes: + array[$(($#array+1))]=$c

Re: [PATCH v2] INSTALL: git-p4 doesn't support Python 3

2013-01-20 Thread Brandon Casey
On Sun, Jan 20, 2013 at 11:28 AM, John Keeping j...@keeping.me.uk wrote: On Sun, Jan 20, 2013 at 10:54:52AM -0800, Junio C Hamano wrote: John Keeping j...@keeping.me.uk writes: git-p4 supports Python 2.6 and later versions of Python 2. Since Python 2.8 will never exist [1], it is most

[PATCH v2 00/10] unify appending of sob

2013-01-21 Thread Brandon Casey
-by: C O Mitter commit...@example.com EOF test_cmp expected actual ' Brandon Casey (8): sequencer.c: remove broken support for rfc2822 continuation in footer t/test-lib-functions.sh: allow to specify the tag name to test_commit t/t3511: add some tests of 'cherry-pick -s' functionality

[PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer

2013-01-21 Thread Brandon Casey
line. Since a commit message is not governed by the line length limits imposed by rfc2822 for email messages, and it does not seem like this functionality would produce better commit messages anyway, let's remove this broken functionality. Signed-off-by: Brandon Casey bca...@nvidia.com

[PATCH v2 02/10] t/test-lib-functions.sh: allow to specify the tag name to test_commit

2013-01-21 Thread Brandon Casey
The message part of test_commit() may not be appropriate for a tag name. So let's allow test_commit to accept a fourth argument to specify the tag name. Signed-off-by: Brandon Casey bca...@nvidia.com --- t/test-lib-functions.sh | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff

[PATCH v2 03/10] t/t3511: add some tests of 'cherry-pick -s' functionality

2013-01-21 Thread Brandon Casey
footer containing a mix of s-o-b like elements and s-o-b elements. (marked expect failure) Signed-off-by: Brandon Casey bca...@nvidia.com --- t/t3511-cherry-pick-x.sh | 111 +++ 1 file changed, 111 insertions(+) create mode 100755 t/t3511-cherry-pick

[PATCH v2 04/10] sequencer.c: recognize (cherry picked from ... as part of s-o-b footer

2013-01-21 Thread Brandon Casey
...@example.com (cherry picked from da39a3ee5e6b4b0d3255bfef95601890afd80709) Signed-off-by: C O Mmitter commit...@example.com Signed-off-by: Brandon Casey bca...@nvidia.com --- sequencer.c | 46 t/t3511-cherry-pick-x.sh | 55

[PATCH v2 05/10] sequencer.c: always separate (cherry picked from from commit body

2013-01-21 Thread Brandon Casey
Start treating the (cherry picked from line added by cherry-pick -x the same way that the s-o-b lines are treated. Namely, separate them from the main commit message body with an empty line. Introduce tests to test this functionality. Signed-off-by: Brandon Casey bca...@nvidia.com

[PATCH v2 06/10] sequencer.c: teach append_signoff how to detect duplicate s-o-b

2013-01-21 Thread Brandon Casey
Teach append_signoff how to detect a duplicate s-o-b in the commit footer. This is in preparation to unify the append_signoff implementations in log-tree.c and sequencer.c. Fixes test in t3511. Signed-off-by: Brandon Casey bca...@nvidia.com --- builtin/commit.c | 2 +- sequencer.c

[PATCH v2 07/10] sequencer.c: teach append_signoff to avoid adding a duplicate newline

2013-01-21 Thread Brandon Casey
. A following patch will make format-patch use this function rather than the append_signoff implementation inside log-tree.c. Signed-off-by: Brandon Casey bca...@nvidia.com --- sequencer.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sequencer.c b/sequencer.c

[PATCH v2 08/10] t4014: more tests about appending s-o-b lines

2013-01-21 Thread Brandon Casey
Ngọc Duy pclo...@gmail.com Signed-off-by: Brandon Casey bca...@nvidia.com --- t/t4014-format-patch.sh | 242 1 file changed, 242 insertions(+) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 7fa3647..3868cef 100755 --- a/t/t4014

[PATCH v2 09/10] format-patch: update append_signoff prototype

2013-01-21 Thread Brandon Casey
From: Nguyễn Thái Ngọc Duy pclo...@gmail.com This is a preparation step for merging with append_signoff from sequencer.c Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Brandon Casey bca...@nvidia.com --- builtin/log.c | 13 + log-tree.c| 14

Re: [PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer

2013-01-22 Thread Brandon Casey
On Mon, Jan 21, 2013 at 11:54 PM, Jonathan Nieder jrnie...@gmail.com wrote: Hi, Brandon Casey wrote: --- a/sequencer.c +++ b/sequencer.c [...] @@ -1042,13 +1041,8 @@ static int ends_rfc2822_footer(struct strbuf *sb, int ignore_footer) Git is checking if (sb-buf) ends with a Signed-off

Re: [PATCH v2 02/10] t/test-lib-functions.sh: allow to specify the tag name to test_commit

2013-01-22 Thread Brandon Casey
On Tue, Jan 22, 2013 at 12:02 AM, Jonathan Nieder jrnie...@gmail.com wrote: Brandon Casey wrote: --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -135,12 +135,13 @@ test_pause () { fi } -# Call test_commit with the arguments message [file [contents]] +# Call

Re: [PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer

2013-01-22 Thread Brandon Casey
On Tue, Jan 22, 2013 at 1:49 AM, Jonathan Nieder jrnie...@gmail.com wrote: Jonathan Nieder wrote: Here is the loop in master: int hit = 0; [...] for (i = len - 1; i 0; i--) { if (hit buf[i] == '\n') break; hit = (buf[i] ==

Re: [PATCH v3 2/8] git_remote_helpers: fix input when running under Python 3

2013-01-25 Thread Brandon Casey
if people would weigh in discussing that in response to [1] but no one has commented on that part of it. As another datapoint, Brandon Casey was suggesting patching git-p4.py to support Python 2.4 [2]. [1] http://article.gmane.org/gmane.comp.version-control.git/213920 [2] http

[PATCH 1/2] git-p4.py: support Python 2.5

2013-01-25 Thread Brandon Casey
to be used with Python 2.5. Signed-off-by: Brandon Casey bca...@nvidia.com --- INSTALL | 2 +- git-p4.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/INSTALL b/INSTALL index 28f34bd..fc723b3 100644 --- a/INSTALL +++ b/INSTALL @@ -131,7 +131,7 @@ Issues of note: use

[PATCH 0/2] git-p4 support for older python

2013-01-25 Thread Brandon Casey
be updated). Brandon Casey (2): git-p4.py: support Python 2.5 git-p4.py: support Python 2.4 INSTALL| 2 +- git-p4.py | 30 ++ t/t9802-git-p4-filetype.sh | 11 ++- 3 files changed, 33 insertions(+), 10 deletions

[PATCH 2/2] git-p4.py: support Python 2.4

2013-01-25 Thread Brandon Casey
a CalledProcessError exception if necessary. The struct.pack_into in t/9802 can be converted into a single struct.pack call which is available in Python 2.4. Signed-off-by: Brandon Casey bca...@nvidia.com --- INSTALL| 2 +- git-p4.py | 27

Re: [PATCH 1/2] git-p4.py: support Python 2.5

2013-01-26 Thread Brandon Casey
On Sat, Jan 26, 2013 at 4:45 AM, Pete Wyckoff p...@padd.com wrote: draf...@gmail.com wrote on Fri, 25 Jan 2013 12:44 -0800: Python 2.5 and older do not accept None as the first argument to translate() and complain with: TypeError: expected a character buffer object Satisfy this older

Re: [PATCH 2/2] git-p4.py: support Python 2.4

2013-01-26 Thread Brandon Casey
On Sat, Jan 26, 2013 at 4:48 AM, Pete Wyckoff p...@padd.com wrote: draf...@gmail.com wrote on Fri, 25 Jan 2013 12:44 -0800: + sys.stdout.write(s); One stray semicolon. Whoops. Thanks. In terms of maintenance, I'll not run tests with 2.4 or 2.5 myself, but maybe you would be willing

[PATCH v2 2/2] git-p4.py: support Python 2.4

2013-01-26 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com Python 2.4 lacks the following features: subprocess.check_call struct.pack_into Take a cue from 460d1026 and provide an implementation of the CalledProcessError exception. Then replace the calls to subproccess.check_call with calls to subprocess.call

[PATCH v2 1/2] git-p4.py: support Python 2.5

2013-01-26 Thread Brandon Casey
From: Brandon Casey draf...@gmail.com Python 2.5 and older do not accept None as the first argument to translate() and complain with: TypeError: expected a character buffer object As suggested by Pete Wyckoff, let's just replace the call to translate() with a regex search which should

Re: [PATCH v2 03/10] t/t3511: add some tests of 'cherry-pick -s' functionality

2013-01-27 Thread Brandon Casey
On Tue, Jan 22, 2013 at 12:17 AM, Jonathan Nieder jrnie...@gmail.com wrote: Brandon Casey wrote: --- /dev/null +++ b/t/t3511-cherry-pick-x.sh [...] +test_expect_failure 'cherry-pick -s inserts blank line after non-conforming footer' ' IIUC this is an illustration of false-positives from

  1   2   3   >