The path of a loose object contains its hash value encoded into two
substrings of 2 and 38 hexadecimal digits separated by a slash. The
first part is handed to for_each_file_in_obj_subdir() in decoded form as
subdir_nr. The current code builds a full hexadecimal representation of
the hash in a
The path of a loose object contains its hash value encoded into two
substrings of hexadecimal digits, separated by a slash. The current
code copies the pieces into a temporary buffer to get rid of the slash
and then uses get_oid_hex() to decode the hash value.
Avoid the copy by using
Make the function for converting pairs of hexadecimal digits to binary
available to other call sites.
Signed-off-by: Rene Scharfe
---
cache.h | 7 +++
hex.c | 12
notes.c | 17 -
3 files changed, 19 insertions(+), 17 deletions(-)
diff --git
Cut off any previous content of the file to be rewritten by passing the
flag O_TRUNC to open(2) instead of calling ftruncate(2) at the end.
That's easier and shorter.
Signed-off-by: Rene Scharfe
---
sequencer.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git
Reduce code duplication by extracting a function for rewriting an
existing file.
Signed-off-by: Rene Scharfe
---
sequencer.c | 46 +-
1 file changed, 17 insertions(+), 29 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index
Am 25.10.2017 um 20:49 schrieb Stefan Beller:
> The implementations in diff.c to detect moved lines needs to compare
> strings and hash strings, which is implemented in that file, as well
> as in the xdiff library.
>
> Remove the rather recent implementation in diff.c and rely on the well
>
Am 25.10.2017 um 20:49 schrieb Stefan Beller:
> +/*
> + * Compare the strings l1 with l2 which are of size s1 and s2 respectively.
> + * Returns 1 if the strings are deemed equal, 0 otherwise.
> + * The `flags` given as XDF_WHITESPACE_FLAGS determine how white spaces
> + * are treated for the
Am 24.10.2017 um 22:42 schrieb Stefan Beller:
> On Tue, Oct 24, 2017 at 1:23 PM, René Scharfe <l@web.de> wrote:
>
>> xdl_recmatch() is already exported; why not use it without this
>> wrapper?
>
> It is exported in xdiff/xutils.h, to be used by various xdif
Am 24.10.2017 um 20:59 schrieb Stefan Beller:
> Instead of using the hash seeded with 5381, and updated via
> `(hash << 5) ^ new_byte`, use the FNV-1 primitives as offered by
> hashmap.h, which is seeded with 0x811c9dc5 and computed as
> `(hash * 0x01000193) ^ new_byte`.
The hash function you're
Am 24.10.2017 um 20:59 schrieb Stefan Beller:
> This will turn out to be useful in a later patch
>
> Signed-off-by: Stefan Beller
> ---
> xdiff-interface.c | 11 +++
> xdiff-interface.h | 5 +
> 2 files changed, 16 insertions(+)
>
> diff --git
Am 24.10.2017 um 20:59 schrieb Stefan Beller:
> This will be useful shortly.
>
> Signed-off-by: Stefan Beller
> ---
> hashmap.c | 7 ++-
> hashmap.h | 3 +++
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/hashmap.c b/hashmap.c
> index
Am 24.10.2017 um 02:52 schrieb Junio C Hamano:
> René Scharfe <l@web.de> writes:
>
>> Am 21.10.2017 um 14:18 schrieb Junio C Hamano:
>>> René Scharfe <l@web.de> writes:
>>>
>>>> FWIW, I use "-?" for that everywhere. I have y
Am 21.10.2017 um 14:18 schrieb Junio C Hamano:
> René Scharfe <l@web.de> writes:
>
>> FWIW, I use "-?" for that everywhere. I have yet to find a command or
>> environment where it does something dangerous.
>
> Yeah, it would have made the world a be
Am 20.10.2017 um 07:35 schrieb Junio C Hamano:
> Jeff King writes:
>
>> It seems weird and inconsistent to me that the meaning of "-h"
>> depends on the position and presence of other unrelated options.
The position is relevant with parse-options for *each* flag for a
different
Am 18.10.2017 um 01:22 schrieb Junio C Hamano:
> René Scharfe <l@web.de> writes:
>
>> Stop advertising -h as the short equivalent of --heads, because it's
>> used for showing a short help text for almost all other git commands.
>> Since the ba5f28bf79 (ls-remote:
Since ba5f28bf79 (ls-remote: use parse-options api) git ls-remote -h
without any other options has shown the short help text of the command
instead of acting as the short equivalent of --heads. Fix this
regression by turning off internal handling of -h for repository setup,
and option parsing, as
Stop advertising -h as the short equivalent of --heads, because it's
used for showing a short help text for almost all other git commands.
Since the ba5f28bf79 (ls-remote: use parse-options api) it has only
been working when used together with other parameters anyway.
Signed-off-by: Rene Scharfe
Builtin commands have skipped repo setup when called with just a single
option -h and thus shown their short help text even outside of
repositories since 99caeed05d3 (Let 'git -h' show usage
without a git dir).
Add the flag NO_INTERNAL_HELP for builtins to opt out of this special
treatment and
Am 15.10.2017 um 13:08 schrieb Martin Ågren:
> On 15 October 2017 at 12:02, Thomas Rikl wrote:
>> Example:
>>
>> tom1 ~/emacs/spacemacs/.emacs.d $ export LANG=en_US.utf8
>>
>> tom1 ~/emacs/spacemacs/.emacs.d $ git ls-remote -h
>> usage: git ls-remote [--heads] [--tags] [--refs]
Am 13.10.2017 um 19:51 schrieb Ralf Thielow:
> When ftruncate() in rearrange_squash() fails, we write
> that we couldn't finish the operation on the todo file.
> It is more accurate to write that we couldn't truncate
> as we do in other calls of ftruncate().
Would it make sense to factor out
[My SMTP server still refuses to accept emails to rpj...@crashcourse.ca
and reports "mailbox unavailable" and "invalid DNS MX or A/ resource
record." So just replying to the list.]
Am 08.10.2017 um 13:56 schrieb Robert P. J. Day:
>but as i asked in my earlier post, if i wanted to
Am 06.10.2017 um 04:23 schrieb Junio C Hamano:
> René Scharfe <l@web.de> writes:
>> +blob_bin=$(echo $blob | hex2oct) &&
>> +tree=$(
>> +printf "4 dir\0${blob_bin}100644 file\0${blob_bin}" |
>
> Wow, that's ... cute.
lookup_blob() and lookup_tree() can return NULL if they find an object
of an unexpected type. Accessing the object member is undefined in that
case. Cast the result to a struct object pointer instead; we can do
that because object is the first member of all object types. This trick
is already
Am 04.10.2017 um 06:00 schrieb Junio C Hamano:
> René Scharfe <l@web.de> writes:
>> lookup_blob() and lookup_tree() can return NULL if they find an object
>> of an unexpected type. Error out of fsck_walk_tree() in that case, like
>> we do when encountering a bad f
- a/.mailmap
+++ b/.mailmap
@@ -194,6 +194,7 @@ Philippe Bruhat <b...@cpan.org>
Ralf Thielow <ralf.thie...@gmail.com> <ralf.thie...@googlemail.com>
Ramsay Jones <ram...@ramsayjones.plus.com> <ram...@ramsay1.demon.co.uk>
René Scharfe <l@web.de> <rene.
Check if the strbuf containing data to sort is empty before attempting
to trim a trailing newline character.
Signed-off-by: Rene Scharfe
---
t/helper/test-string-list.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/helper/test-string-list.c
Am 03.10.2017 um 14:51 schrieb René Scharfe:
> Am 03.10.2017 um 12:22 schrieb SZEDER Gábor:
>> Furthermore, fsck.c:fsck_walk_tree() does the same "immediately
>> reference the object member in lookup_blob()'s and lookup_tree()'s
>> return value" thing. I thin
Am 03.10.2017 um 12:22 schrieb SZEDER Gábor:
>> lookup_blob() etc. can return NULL if the referenced object isn't of the
>> expected type. In theory it's wrong to reference the object member in
>> that case. In practice it's OK because it's located at offset 0 for all
>> types, so the pointer
[When I try to reply to rpj...@crashcourse.ca then my SMTP server
says "Requested action not taken: mailbox unavailable
invalid DNS MX or A/ resource record.", so I'm replying only
to the list.]
Am 02.10.2017 um 12:13 schrieb rpj...@crashcourse.ca:
> i'm sure i'm about to embarrass myself
Am 02.10.2017 um 07:08 schrieb Jeff King:
> On Sun, Oct 01, 2017 at 04:45:13PM +0200, René Scharfe wrote:
>
>> lookup_blob() etc. can return NULL if the referenced object isn't of the
>> expected type. In theory it's wrong to reference the object member in
>> that ca
Use the macro ALLOC_ARRAY to allocate an array. This is shorter and
eaasier, as it automatically infers the size of elements.
Patch generated with Coccinelle and contrib/coccinelle/array.cocci.
Signeg-off-by: Rene Scharfe
---
run-command.c | 2 +-
1 file changed, 1 insertion(+),
Transformations that hide multiplications can end up with an pair of
parentheses that is no longer needed. E.g. with a rule like this:
@@
expression E;
@@
- E * 2
+ double(E)
... we might get a patch like this:
- x = (a + b) * 2;
+ x = double((a + b));
Add a pair of
This is shorter, easier and makes the intent clearer.
Patch generated with Coccinelle and contrib/coccinelle/strbuf.cocci.
Signed-off-by: Rene Scharfe
---
builtin/commit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/commit.c b/builtin/commit.c
strbuf_addf() can be used with "%.*s" to add a buffer of a specific size
to a strbuf, but the resulting code is longer, may require casting the
length to int and is less efficient than simply calling strbuf_add().
Add Coccinelle rules for transforming calls of the former type to the
latter.
strbuf_addf() can be used to add a specific number of space characters
by using the format "%*s" with an empty string and specifying the
desired width. Use strbuf_addchars() instead as it's shorter, makes the
intent clearer and is a bit more efficient.
Signed-off-by: Rene Scharfe
lookup_blob() etc. can return NULL if the referenced object isn't of the
expected type. In theory it's wrong to reference the object member in
that case. In practice it's OK because it's located at offset 0 for all
types, so the pointer arithmetic (NULL + 0) is optimized out by the
compiler.
Use the macro FREE_AND_NULL to release allocated objects and clear their
pointers. This is shorter and documents the intent better by combining
the two related operations into one.
Patch generated with Coccinelle and contrib/coccinelle/free.cocci.
Signed-off-by: Rene Scharfe
---
Avoid a string copy to a static buffer by using strbuf_add_real_path()
instead of combining strbuf_addstr() and real_path().
Patch generated by Coccinelle and contrib/coccinelle/strbuf.cocci.
Signed-off-by: Rene Scharfe
---
path.c | 2 +-
1 file changed, 1 insertion(+), 1
Use strbuf_addstr() instead of strbuf_addf() for adding strings. That's
simpler and makes the intent clearer.
Patch generated by Coccinelle and contrib/coccinelle/strbuf.cocci;
adjusted indentation in refs/packed-backend.c manually.
Signed-off-by: Rene Scharfe
---
This allows us to get rid of several write-only variables.
Signed-off-by: Rene Scharfe
---
builtin/checkout.c | 3 +--
builtin/receive-pack.c | 3 +--
ref-filter.c | 7 ++-
reflog-walk.c | 6 ++
transport.c| 3 +--
wt-status.c
This gets us rid of a write-only variable.
Signed-off-by: Rene Scharfe
---
refs/files-backend.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index fec77744b4..ed00ddab1a 100644
--- a/refs/files-backend.c
+++
Am 24.09.2017 um 03:26 schrieb Junio C Hamano:
> I wonder if we want a dedicated helper for them (perhaps about a
> dozen callers we have that fall into this pattern?) to call for the
> exact purpose, implemented as a thin-wrapper around the
> resolve_ref_unsafe() function, though.
Am 23.09.2017 um 20:04 schrieb René Scharfe:
> Decode =XY in quoted-printable segments only if X and Y are hexadecimal
> digits, otherwise just copy them. That's at least better than
> interpreting negative results from hexval() as a character.
Forgot to add:
Reported-by: Jef
Decode =XY in quoted-printable segments only if X and Y are hexadecimal
digits, otherwise just copy them. That's at least better than
interpreting negative results from hexval() as a character.
Signed-off-by: Rene Scharfe
---
mailinfo.c | 11 ---
1 file changed, 8
This allows us to get rid of two write-only variables, one of them
being a SHA1 buffer.
Signed-off-by: Rene Scharfe
---
refs/files-backend.c | 3 +--
worktree.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/refs/files-backend.c
This allows us to get rid of some write-only variables, among them seven
SHA1 buffers.
Signed-off-by: Rene Scharfe
---
branch.c| 3 +--
builtin/commit.c| 3 +--
builtin/log.c | 3 +--
builtin/receive-pack.c | 3 +--
Allow callers of refs_resolve_ref_unsafe() to pass NULL if they don't
need the resolved hash value. We already allow the same for the flags
parameter. This new leniency is inherited by the various wrappers like
resolve_ref_unsafe().
Signed-off-by: Rene Scharfe
---
refs.c | 3 +++
Am 22.09.2017 um 07:47 schrieb Jeff King:
> On Thu, Sep 21, 2017 at 05:48:38PM +0100, Ramsay Jones wrote:
>
>> diff --git a/cache.h b/cache.h
>> index a916bc79e..a0e3e362c 100644
>> --- a/cache.h
>> +++ b/cache.h
>> @@ -1243,8 +1243,8 @@ static inline unsigned int hexval(unsigned char c)
>>*/
Am 13.09.2017 um 14:53 schrieb Jeff King:
> On Wed, Sep 13, 2017 at 12:43:57AM +0200, René Scharfe wrote:
>> Yet another way is have a few levels of nested subdirectories (e.g.
>> d1/d2/d3/file1) and ignoring the entries at the leaved (e.g. file1).
>
> s/leaved/leaves/ ?
Indeed.
René
Am 20.08.2017 um 11:06 schrieb Jeff King:
> I actually think it would be reasonable to omit the empty directory in
> t5004. The main thing we care about there is that we produce an archive
> with no files rather than barfing. Checking that the empty directory is
> actually there was mostly "this
Am 10.09.2017 um 19:38 schrieb Jeff King:
> On Sun, Sep 10, 2017 at 12:37:06PM +0200, René Scharfe wrote:
>
>>> And in fact, being called from a signal handler means we should
>>> generally avoid touching malloc or free (which could be holding locks).
>>>
Am 10.09.2017 um 09:30 schrieb Jeff King:
> On Sun, Sep 10, 2017 at 08:27:40AM +0200, René Scharfe wrote:
>
>>>>if (junk_work_tree) {
>>>>strbuf_addstr(, junk_work_tree);
>>>>remove_dir_recu
Am 08.09.2017 um 11:21 schrieb Jeff King:
> Note that the non-stdin path no longer looks at the "mailmap" entry of
> "struct shortlog" (instead we use the one cached inside pretty.c). But
> we still waste time loading it. I'm not sure if it's worth addressing
> that. It's only once per program
Am 06.09.2017 um 21:51 schrieb Junio C Hamano:
> Rene Scharfe writes:
>
>> Signed-off-by: Rene Scharfe
>> ---
>> builtin/clone.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/builtin/clone.c b/builtin/clone.c
>> index
Am 06.09.2017 um 21:51 schrieb Junio C Hamano:
> Rene Scharfe writes:
>
>> If format_tracking_info() returns 0 only if it didn't touch its strbuf
>> parameter, so it's OK to exit early in that case. Clean up sb in the
>> other case.
>
> These two "if"s confuse me; perhaps the
Am 01.09.2017 um 19:11 schrieb Stefan Beller:
> On Fri, Sep 1, 2017 at 12:29 AM, Nicolas Morey-Chaisemartin
> wrote:
>> git pull used to not parse the submodule.recurse config option and simply
>> consider the --recurse-submodules CLI option.
>> When using the
Am 30.08.2017 um 20:23 schrieb Martin Ågren:
> On 30 August 2017 at 19:49, Rene Scharfe wrote:
>> Signed-off-by: Rene Scharfe
>> ---
>> mailinfo.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/mailinfo.c b/mailinfo.c
>> index b1f5159546..f2387a3267
We check the date of epoch timestamp candidates already with
starts_with(). Move beyond that part using skip_prefix() instead of
checking it again using a regular expression. Also group the minutes
part, so that we can access them using a substring match instead of
using a magic number.
has_epoch_timestamp() looks for time stamps that amount to either
1969-12-31 24:00 or 1970-01-01 00:00 after applying the time zone
offset. Move the check for these two dates up, set the expected hour
based on which one is found, or exit early if none of them are present,
thus avoiding to engage
Am 21.08.2017 um 17:48 schrieb Ramsay Jones:
>
> Commit 67a9dfcc00 ("hash-algo: integrate hash algorithm support with
> repo setup", 21-08-2017) added a 'const struct git_hash_algo *hash_algo'
> field to the repository structure, without modifying the initializer
> of the 'the_repo' variable.
Am 19.08.2017 um 18:53 schrieb René Scharfe:
> Am 19.08.2017 um 07:33 schrieb René Scharfe:
>> When read_tree_recursive() encounters a directory excluded by a pathspec
>> then it enters it anyway because it might contain included entries. It
>> calls the callback funct
Am 19.08.2017 um 07:33 schrieb René Scharfe:
> When read_tree_recursive() encounters a directory excluded by a pathspec
> then it enters it anyway because it might contain included entries. It
> calls the callback function before it is able to decide if the directory
> is act
53b2c823f6 (revision walker: mini clean-up) added the function in 2007,
but it was never used, so we should be able to get rid of it now.
Signed-off-by: Rene Scharfe
---
commit.h | 5 -
1 file changed, 5 deletions(-)
diff --git a/commit.h b/commit.h
index
Reject directories with the attribute export-ignore already while
queuing them. This prevents read_tree_recursive() from descending into
them and this avoids write_archive_entry() rejecting them later on,
which queue_or_write_archive_entry() is not prepared for.
Borrow the existing strbuf to
When read_tree_recursive() encounters a directory excluded by a pathspec
then it enters it anyway because it might contain included entries. It
calls the callback function before it is able to decide if the directory
is actually needed.
For that reason git archive adds directories to a queue and
Add helpers for accessing attributes that encapsulate the details of how
to retrieve their values.
Signed-off-by: Rene Scharfe
---
archive.c | 31 +++
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/archive.c b/archive.c
index
Demonstrate mishandling of the attribute export-ignore by git archive
when used together with pathspecs. Wildcard pathspecs can even cause it
to abort. And a directory excluded without a wildcard is still included
as an empty folder in the archive.
Test-case-by: David Adam
Am 14.08.2017 um 18:43 schrieb René Scharfe:
> The real solution is probably to teach tree-walk.c::do_match() how to
> handle attributes and then inject ":(attr:-export-ignore)" as a default
> internal pathspec in archive.c::parse_pathspec_arg() instead of handlin
Am 15.08.2017 um 02:46 schrieb Jonathan Nieder:
> Hi,
>
> René Scharfe wrote:
>> We already compare changed files with their expected new contents using
>> diff(1), so we don't need to check with "test_must_fail test_cmp" if
>> they differ from their origina
Am 14.08.2017 um 22:16 schrieb René Scharfe:
> sum(1) is a command for calculating checksums of the contents of files.
> It was part of early editions of Unix ("Research Unix", 1972/1973, [1]).
> cksum(1) appeared in 4.4BSD (1993) as a replacement [2], and became part
&
sum(1) is a command for calculating checksums of the contents of files.
It was part of early editions of Unix ("Research Unix", 1972/1973, [1]).
cksum(1) appeared in 4.4BSD (1993) as a replacement [2], and became part
of POSIX.1-2008 [3]. OpenBSD 5.6 (2014) removed sum(1).
We only use sum(1) in
Am 13.08.2017 um 06:53 schrieb David Adam:
> Hi all,
>
> I think I have a bug in git (tested 2.11.0 on Debian 8, 2.14.1 on OS X and
> 2.14.1.145.gb3622a4 on OS X).
>
> Given a repository with an export-ignore directive for a subdirectory in
> .gitattributes, `git archive` with a pathspec that
Am 13.08.2017 um 06:32 schrieb Jeff King:
> On Sat, Aug 12, 2017 at 01:57:06PM +0200, René Scharfe wrote:
>
>> But we probably want to check for other errors. They look unlikely
>> enough that we may get away with something like this:
>>
>>
Am 12.08.2017 um 13:57 schrieb René Scharfe:
> Update: Just noticed that on the BSDs getdelim(3) doesn't set errno
> to ENOMEM on allocation failure, but does set the error indicator.
> That might be an oversight on their part, but that means we
> certainly *need* to
Am 12.08.2017 um 12:02 schrieb Simon Ruderich:
> On Fri, Aug 11, 2017 at 10:52:51AM +0200, René Scharfe wrote:
>> Am 11.08.2017 um 09:50 schrieb Simon Ruderich:
>>> On Thu, Aug 10, 2017 at 10:56:40PM +0200, René Scharfe wrote:
>>>> getdelim(3) returns -1 at the end of
All callers of fill_tree_descriptor() have been converted to object_id
already, so convert that function as well. As a nice side-effect we get
rid of NULL checks in tree-diff.c, as fill_tree_descriptor() already
does them for us.
Helped-by: Johannes Sixt
Signed-off-by: Rene
All callers of fill_tree_descriptor() have been converted to object_id
already, so convert that function as well. As a nice side-effect we get
rid of NULL checks in tree-diff.c, as fill_tree_descriptor() already
does them for us.
Signed-off-by: Rene Scharfe
---
Am 10.08.2017 um 20:47 schrieb Kevin Willford:
> String formatting can be a performance issue when there are
> hundreds of thousands of trees.
>
> Change to stop using the strbuf_addf and just add the strings
> or characters individually.
>
> There are a limited number of modes so added a switch
Am 11.08.2017 um 01:41 schrieb Jeff King:
> On Wed, Aug 09, 2017 at 05:54:46PM +0200, René Scharfe wrote:
>
>> Use a NULL-and-NUL check to see if we have a prefix and consistently use
>> C string functions on it instead of storing its length in a member of
>> struct a
Am 11.08.2017 um 09:50 schrieb Simon Ruderich:
> On Thu, Aug 10, 2017 at 10:56:40PM +0200, René Scharfe wrote:
>> getdelim(3) returns -1 at the end of the file and if it encounters an
>> error, but sets errno only in the latter case. Set errno to zero before
>> calling it t
getdelim(3) returns -1 at the end of the file and if it encounters an
error, but sets errno only in the latter case. Set errno to zero before
calling it to avoid misdiagnosing an out-of-memory condition due to a
left-over value from some other function call.
Reported-by: Yaroslav Halchenko
Am 10.08.2017 um 20:56 schrieb Junio C Hamano:
> René Scharfe <l@web.de> writes:
>
>> I doubt the type of file system matters. The questions are: How much
>> main memory do you have, what is git trying to cram into it, is there
>> a way to reduce the memory f
Am 10.08.2017 um 16:43 schrieb Yaroslav Halchenko:
> On Thu, 10 Aug 2017, René Scharfe wrote:
>> Am 09.08.2017 um 19:39 schrieb Yaroslav Halchenko:
>>> More context (may be different issue(s)) could be found at
>>> http://git-annex.branchable.com/forum/git-an
Get rid of a magic string length constant by using skip_prefix() instead
of starts_with().
Signed-off-by: Rene Scharfe
---
builtin/merge.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/merge.c b/builtin/merge.c
index 900bafdb45..4facb6fdd0 100644
Am 09.08.2017 um 19:39 schrieb Yaroslav Halchenko:
> More context (may be different issue(s)) could be found at
> http://git-annex.branchable.com/forum/git-annex_add_out_of_memory_error/
> but currently I am consistently reproducing it while running
> git (1:2.11.0-3 debian stretch build) within
If realloc() fails then the original buffer is still valid. Free it
before exiting the function.
Signed-off-by: Rene Scharfe
---
compat/win32/syslog.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/compat/win32/syslog.c b/compat/win32/syslog.c
index 6c7c9b6053..161978d720
When unpack_entry() encounters a broken packed object, it returns early.
It adjusts the reference count of the pack window, but leaks the buffer
for a big delta stack in case the small automatic one was not enough.
Jump to the cleanup code at end instead, which takes care of that.
Signed-off-by:
Move the code for releasing tree buffers and commit buffers in
fsck_obj() to the end of the function and make sure it's executed no
matter of an error is encountered or not.
Signed-off-by: Rene Scharfe
---
builtin/fsck.c | 22 +++---
1 file changed, 11
Am 09.08.2017 um 19:47 schrieb Junio C Hamano:
> René Scharfe <l@web.de> writes:
>
>> There could be any characters except NUL and LF between the 4096 zeros
>> and "0$" for the latter to match wrongly, no? So there are 4095
>> opportunit
Am 09.08.2017 um 18:07 schrieb Junio C Hamano:
> René Scharfe <l@web.de> writes:
>
>>> In the face of unreliable segfaults we need to reverse our strategy,
>>> I think. Searching for something not in the buffer (e.g. "1") and
>>> considering m
Use a NULL-and-NUL check to see if we have a prefix and consistently use
C string functions on it instead of storing its length in a member of
struct apply_state. This avoids strlen() calls and simplifies the code.
Signed-off-by: Rene Scharfe
---
apply.c | 12 +---
Am 09.08.2017 um 12:16 schrieb Jeff King:
> In 1a812f3a70 (hashcmp(): inline memcmp() by hand to
> optimize, 2011-04-28), it was reported that an open-coded
> loop outperformed memcmp() for comparing sha1s.
>
> Discussion[1] a few years later in 2013 showed that this
> depends on your libc's
Am 09.08.2017 um 08:15 schrieb René Scharfe:
> Am 09.08.2017 um 07:29 schrieb Junio C Hamano:
>> René Scharfe <l@web.de> writes:
>>
>>> Am 09.08.2017 um 00:26 schrieb Junio C Hamano:
>>>> ... but in the meantime, I think replacing the test with &qu
Am 09.08.2017 um 07:29 schrieb Junio C Hamano:
> René Scharfe <l@web.de> writes:
>
>> Am 09.08.2017 um 00:26 schrieb Junio C Hamano:
>>> ... but in the meantime, I think replacing the test with "0$" to
>>> force the scanner to find either th
Am 09.08.2017 um 00:26 schrieb Junio C Hamano:
> Junio C Hamano writes:
>
>> So I find Dscho's concern quite valid, even though I do believe you
>> when you say the code somehow segfaults. I just can not tell
>> how/why it would segfault, though---it is possible that
Am 09.08.2017 um 00:09 schrieb Junio C Hamano:
> René Scharfe <l@web.de> writes:
>
>> Am 08.08.2017 um 16:49 schrieb Johannes Schindelin:
>>> Hi René,
>>>
>>> On Tue, 8 Aug 2017, René Scharfe wrote:
>>>
>>>> OpenBSD's reg
find_pack_entry_one() uses the fan-out table of pack indexes to find out
which entries match the first byte of the searched hash and does a
binary search on this subset of the main index table.
If there are no matching entries then lo and hi will have the same
value. The binary search still
Am 08.08.2017 um 23:36 schrieb Ramsay Jones:
>
> Signed-off-by: Ramsay Jones
> ---
>
> Hi Junio,
>
> I noticed this while looking into the t3700 failure on cygwin tonight.
> Also, I couldn't decide whether or not to add the i18n '_()' brackets
> around the message.
76e368c378 (t3700: fix broken test under !SANITY) explains that the test
'git add --chmod=[+-]x changes index with already added file' can fail
if xfoo3 is still present as a symlink from a previous test and deletes
it with rm(1). That still leaves it present in the index, which causes
the test
Am 08.08.2017 um 17:18 schrieb Adam Dinwoodie:
> The t3700-add.sh test is currently failing on the pu branch on Cygwin.
> To my surprise, the problem appears to have been introduced by a merge,
> 867fa1d6a. Both parents of that merge have the test succeeding, but
> it's failing on that merge
201 - 300 of 1163 matches
Mail list logo