[PATCH] strbuf_read: skip unnecessary strbuf_grow at eof

2015-05-31 Thread Jim Hill
Make strbuf_read not try to do read_in_full's job too. If xread returns less than was requested it can be either eof or an interrupted read. If read_in_full returns less than was requested, it's eof. Use read_in_full to detect eof and not iterate when eof has been seen. Signed-off-by

[PATCH 0/2] don't add duplicate paths to info/alternates

2015-05-31 Thread Jim Hill
These patches address http://thread.gmane.org/gmane.comp.version-control.git/269050/focus=269415 linked from the git blame page, avoiding adding duplicates to info/alternates and removing hold_lock_file_for_append which is too heavyweight for logging and too limited for anything else. There's an a

[PATCH 2/2] remove hold_lock_file_for_append

2015-05-31 Thread Jim Hill
No uses of hold_lock_file_for_append remain, so remove it. hold_lock_file_for_append copies its target file internally. This makes it too heavyweight for logging and too limited for anything else. It shouldn't be used. Signed-off-by: Jim Hill --- lockfile.c

[PATCH 1/2] add_to_alternates_file: don't add duplicate paths

2015-05-31 Thread Jim Hill
Check for an existing match before appending a path to the alternates file. Beyond making git look smart to anyone checking the alternates file, this removes the last use of hold_lock_file_for_append. Signed-off-by: Jim Hill --- sha1_file.c| 29 + t

[PATCH v4] sha1_file: pass empty buffer to index empty file

2015-05-17 Thread Jim Hill
ot;use the buffer", but it seems to me that the distinction between a missing buffer and an empty one carries intrinsic semantics, where the logic change is adapting the code to handle incorrect arguments. Signed-off-by: Jim Hill --- Okay, that's it: I'm officially laughably rusty,

Re: [PATCH v2] sha1_file: pass empty buffer to index empty file

2015-05-15 Thread Jim Hill
On Fri, May 15, 2015 at 11:01:34AM -0700, Junio C Hamano wrote: > That would mean that you found _another_ bug, wouldn't it? If > copy-fd failed to read input to feed the external filter with, it > must have returned an error to its caller, and somebody in the > callchain is not paying attention t

[PATCH v2] pre-push.sample: remove unwanted `IFS=' '`.

2014-12-21 Thread Jim Hill
1 --grep '\bbad string\b' $range` which fails with IFS=' ' because newlines aren't valid in commit id's Signed-off-by: Jim Hill --- templates/hooks--pre-push.sample | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/hooks--pre-push.sample b/templates/hoo

Re: [PATCH w/signoff] pre-push.sample: Remove unwanted `IFS=' '`.

2014-12-21 Thread Jim Hill
I call it unwanted because the default works fine with the actual input and explicitly limiting whitespace this way breaks most command substitution. For instance, attempting to check only new commits with range="$local_sha $( git for-each-ref --format='^%(refname)' refs/remotes/$

[PATCH w/signoff] pre-push.sample: Remove unwanted `IFS=' '`.

2014-12-21 Thread Jim Hill
Signed-off-by: Jim Hill --- templates/hooks--pre-push.sample | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample index 69e3c67..6187dbf 100755 --- a/templates/hooks--pre-push.sample +++ b/templates/hooks--pre-push.sample @@ -24,7

[PATCH] pre-push.sample: Remove unwanted `IFS=' '`.

2014-12-21 Thread Jim Hill
--- templates/hooks--pre-push.sample | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample index 69e3c67..6187dbf 100755 --- a/templates/hooks--pre-push.sample +++ b/templates/hooks--pre-push.sample @@ -24,7 +24,6 @@ url="$2" z40=

Re: [PATCH] commit: Add -f, --fixes option to add Fixes: line

2013-10-27 Thread Jim Hill
On 10/26/13 18:34, Josh Triplett wrote: Linux Kernel ... "Fixes:" line ... containing an abbreviated commit hash This helps people (or automated tools) determine how far to backport I beg pardon if I'm rehearsing an old debate, but it seems to me it would be better and worthwhile to bring