Re: [PATCH 1/2] fsck: use strbuf_getline() to read skiplist file

2018-08-11 Thread René Scharfe
Am 11.08.2018 um 18:48 schrieb Jeff King: And one I'm not sure about: - a read() error will now be quietly ignored; I guess we'd have to check ferror(fp) to cover this. I'm not sure if it matters. I'm not sure, either. It would catch media errors or file system corruption, right? Sound

[PATCH 2/2] fsck: use oidset for skiplist

2018-08-11 Thread René Scharfe
Object IDs to skip are stored in a shared static oid_array. Lookups do a binary search on the sorted array. The code checks if the object IDs are already in the correct order while loading and skips sorting in that case. Simplify the code by using an oidset instead. Memory usage is a bit highe

[PATCH 1/2] fsck: use strbuf_getline() to read skiplist file

2018-08-11 Thread René Scharfe
The char array named "buffer" is unlikely to contain a NUL character, so printing its contents using %s in a die() format is unsafe. Clang's ASan reports running over the end of buffer in the recently added skiplist tests in t5504-fetch-receive-strict.sh as a result. Use an idiomatic strbuf_getl

Re: Re* [PATCH] push: comment on a funny unbalanced option help

2018-08-02 Thread René Scharfe
Am 02.08.2018 um 22:36 schrieb Junio C Hamano: > Ævar Arnfjörð Bjarmason writes: > >> Thanks, FWIW that's fine by me, and also if you want to drop this "fake" >> patch of mine and replace it with something René came up with (I have >> not yet read his 1-6 patches submitted on this topic, so maybe

Re: [PATCH] push: comment on a funny unbalanced option help

2018-08-02 Thread René Scharfe
Am 02.08.2018 um 22:01 schrieb Junio C Hamano: > René Scharfe writes: > >> Am 02.08.2018 um 18:54 schrieb Jeff King: >>> PS I actually would have made the rule simply "does it begin with a >>> '<'", which seems simpler still. If people

[PATCH 6/6] parse-options: automatically infer PARSE_OPT_LITERAL_ARGHELP

2018-08-02 Thread René Scharfe
Parseopt wraps argument help strings in a pair of angular brackets by default, to tell users that they need to replace it with an actual value. This is useful in most cases, because most option arguments are indeed single values of a certain type. The option PARSE_OPT_LITERAL_ARGHELP needs to be

[PATCH 5/6] shortlog: correct option help for -w

2018-08-02 Thread René Scharfe
Wrap the placeholders in the option help string for -w in pairs of angular brackets to document that users need to replace them with actual numbers. Use the flag PARSE_OPT_LITERAL_ARGHELP to prevent parseopt from adding another pair. Signed-off-by: Rene Scharfe --- builtin/shortlog.c | 6 --

[PATCH 4/6] send-pack: specify --force-with-lease argument help explicitly

2018-08-02 Thread René Scharfe
Wrap each part of the argument help string in angular brackets to show that users need to replace them with actual values. Do that explicitly to balance the pairs nicely in the code and avoid confusing casual readers. Add the flag PARSE_OPT_LITERAL_ARGHELP to keep parseopt from adding another pai

[PATCH 3/6] pack-objects: specify --index-version argument help explicitly

2018-08-02 Thread René Scharfe
Wrap both placeholders in the argument help string in angular brackets to signal that users needs replace them with some actual value. Use the flag PARSE_OPT_LITERAL_ARGHELP to prevent parseopt from adding another pair. Signed-off-by: Rene Scharfe --- builtin/pack-objects.c | 4 ++-- 1 file cha

[PATCH 2/6] difftool: remove angular brackets from argument help

2018-08-02 Thread René Scharfe
Parseopt wraps arguments in a pair of angular brackets by default, signifying that the user needs to replace it with a value of the documented type. Remove the pairs from the option definitions to duplication and confusion. Signed-off-by: Rene Scharfe --- builtin/difftool.c | 4 ++-- 1 file cha

[PATCH 1/6] add, update-index: fix --chmod argument help

2018-08-02 Thread René Scharfe
Don't translate the argument specification for --chmod; "+x" and "-x" are the literal strings that the commands accept. Separate alternatives using a pipe character instead of a slash, for consistency. Use the flag PARSE_OPT_LITERAL_ARGHELP to prevent parseopt from adding a pair of angular bracke

Re: [PATCH] push: comment on a funny unbalanced option help

2018-08-02 Thread René Scharfe
Am 02.08.2018 um 18:54 schrieb Jeff King: > PS I actually would have made the rule simply "does it begin with a > '<'", which seems simpler still. If people accidentally write " forgetting to close their brackets, that is a bug under both the > old and new behavior (just with slightly d

Re: [PATCH] push: comment on a funny unbalanced option help

2018-08-02 Thread René Scharfe
Am 02.08.2018 um 17:31 schrieb Junio C Hamano: > René Scharfe writes: >> diff --git a/parse-options.c b/parse-options.c >> index 7db84227ab..fadfc6a833 100644 >> --- a/parse-options.c >> +++ b/parse-options.c >> @@ -660,7 +660,8 @@ int parse_options(int argc,

Re: Re* [PATCH] push: comment on a funny unbalanced option help

2018-08-02 Thread René Scharfe
> the end result would balance out, by somebody who forgot the > presence of PARSE_OPT_LITERAL_ARGHELP, which is the escape hatch > mechanism designed to help such a case. We just should use the > official escape hatch instead. > > Helped-by: René Scharfe I didn't do anyt

Re: [PATCH] push: comment on a funny unbalanced option help

2018-08-02 Thread René Scharfe
Am 02.08.2018 um 17:06 schrieb René Scharfe: > According to its manpage the option should rather be shown like this: > > --force-with-lease[=[:]] > > ... to indicate that all three forms are valid: > > --force-with-lease > --force-with-lease=some_ref &g

Re: [PATCH] push: comment on a funny unbalanced option help

2018-08-02 Thread René Scharfe
Am 02.08.2018 um 16:21 schrieb Ævar Arnfjörð Bjarmason: > > On Thu, Aug 02 2018, René Scharfe wrote: > >> Am 02.08.2018 um 00:31 schrieb Ævar Arnfjörð Bjarmason: >>> But looking at this again it looks like this whole thing should just be >>> replaced by: >>

Re: [PoC] coccinelle: make Coccinelle-related make targets more fine-grained

2018-08-02 Thread René Scharfe
Am 02.08.2018 um 13:55 schrieb SZEDER Gábor: > Let's add a bit of Makefile metaprogramming to generate finer-grained > make targets applying one semantic patch to only a single source file, > and specify these as dependencies of the targets applying one semantic > patch to all source files. This w

Re: [PATCH] push: comment on a funny unbalanced option help

2018-08-02 Thread René Scharfe
Am 02.08.2018 um 00:31 schrieb Ævar Arnfjörð Bjarmason: > But looking at this again it looks like this whole thing should just be > replaced by: > > diff --git a/builtin/push.c b/builtin/push.c > index 9cd8e8cd56..b8fa15c101 100644 > --- a/builtin/push.c > +++ b/builtin/push.c

Re: [PATCH] remote: clear string_list after use in mv()

2018-08-02 Thread René Scharfe
Thank you for the review! Am 02.08.2018 um 04:56 schrieb Jonathan Nieder: > René Scharfe wrote: > >> Subject: remote: clear string_list after use in mv() > > This subject line doesn't fully reflect the goodness of this change. > How about something like: > >

[PATCH] remote: clear string_list after use in mv()

2018-08-01 Thread René Scharfe
Switch to the _DUP variant of string_list for remote_branches to allow string_list_clear() to release the allocated memory at the end, and actually call that function. Free the util pointer as well; it is allocated in read_remote_branches(). NB: This string_list is empty until read_remote_branche

Re: git merge -s subtree seems to be broken.

2018-07-31 Thread René Scharfe
Am 31.07.2018 um 17:50 schrieb Jeff King: > On Tue, Jul 31, 2018 at 11:03:17AM -0400, George Shammas wrote: > >> Bisecting around, this might be the commit that introduced the breakage. >> >> https://github.com/git/git/commit/d8febde >> >> I really hope that it hasn't been broken for 5 years and I

Re: git merge -s subtree seems to be broken.

2018-07-31 Thread René Scharfe
Am 31.07.2018 um 23:06 schrieb Junio C Hamano: > Jeff King writes: > >> On Tue, Jul 31, 2018 at 01:23:04PM -0400, Jeff King wrote: >> ... >> So here it is fixed, and with a commit message. I'm not happy to omit a >> regression test, but I actually couldn't come up with a minimal one that >> tickl

Re: Proposed approaches to supporting HTTP remotes in "git archive"

2018-07-29 Thread René Scharfe
Am 28.07.2018 um 00:32 schrieb Junio C Hamano: > Josh Steadmon writes: > >> # Supporting HTTP remotes in "git archive" >> >> We would like to allow remote archiving from HTTP servers. There are a >> few possible implementations to be discussed: >> >> ## Shallow clone to temporary repo >> >> This

Re: [PATCH 0/5] Misc Coccinelle-related improvements

2018-07-23 Thread René Scharfe
Am 23.07.2018 um 15:50 schrieb SZEDER Gábor: > Just a couple of minor Coccinelle-related improvements: > >- The first two patches are small cleanups. > >- The last three could make life perhaps just a tad bit easier for > devs running 'make coccicheck'. > > > SZEDER Gábor (5): >

Re: [PATCH 0/7] grep.c: teach --column to 'git-grep(1)'

2018-06-19 Thread René Scharfe
Am 19.06.2018 um 21:11 schrieb Jeff King: > On Tue, Jun 19, 2018 at 08:50:16PM +0200, René Scharfe wrote: > >> Negation causes the whole non-matching line to match, with --column >> reporting 1 or nothing in such a case, right? Or I think doing the >> same when the oper

Re: [PATCH 0/7] grep.c: teach --column to 'git-grep(1)'

2018-06-19 Thread René Scharfe
Am 19.06.2018 um 19:44 schrieb Taylor Blau: > diff --git a/grep.c b/grep.c > index f3329d82ed..a09935d8c5 100644 > --- a/grep.c > +++ b/grep.c > @@ -1257,8 +1257,8 @@ static int match_one_pattern(struct grep_pat *p, char > *bol, char *eol, > return hit; > } > > -static int match_expr_eval

Re: [PATCH 0/7] grep.c: teach --column to 'git-grep(1)'

2018-06-19 Thread René Scharfe
Am 19.06.2018 um 19:48 schrieb Jeff King: > On Tue, Jun 19, 2018 at 07:33:39PM +0200, René Scharfe wrote: > >>> The key thing about this iteration is that it doesn't regress >>> performance, because we always short-circuit where we used to. The other >>> obv

Re: [PATCH 0/7] grep.c: teach --column to 'git-grep(1)'

2018-06-19 Thread René Scharfe
Am 19.06.2018 um 19:44 schrieb Taylor Blau: > On Tue, Jun 19, 2018 at 07:33:39PM +0200, René Scharfe wrote: >> Am 19.06.2018 um 18:35 schrieb Jeff King: >>> On Mon, Jun 18, 2018 at 06:43:01PM -0500, Taylor Blau wrote: >> We could add an optimizer pass to reduce the number o

Re: [PATCH 0/7] grep.c: teach --column to 'git-grep(1)'

2018-06-19 Thread René Scharfe
Am 19.06.2018 um 18:35 schrieb Jeff King: > On Mon, Jun 18, 2018 at 06:43:01PM -0500, Taylor Blau wrote: >> The notable case that it does _not_ cover is matching the following >> line: >> >>a ... b >> >> with the following expression >> >>git grep --column -e b --or -e a >> >> This will pro

Re: [PATCH 24/30] merge-recursive: Add computation of collisions due to dir rename & merging

2018-06-10 Thread René Scharfe
Am 10.06.2018 um 12:56 schrieb René Scharfe: > Am 10.11.2017 um 20:05 schrieb Elijah Newren: >> +static struct dir_rename_entry *check_dir_renamed(const char *path, >> + struct hashmap *dir_renames) { >> +char temp[PATH_MA

Re: [PATCH 24/30] merge-recursive: Add computation of collisions due to dir rename & merging

2018-06-10 Thread René Scharfe
Am 10.11.2017 um 20:05 schrieb Elijah Newren: > +static struct dir_rename_entry *check_dir_renamed(const char *path, > + struct hashmap *dir_renames) { > + char temp[PATH_MAX]; > + char *end; > + struct dir_rename_entry *entry; > + > + s

Re: [PATCH 2/2] builtin/blame: highlight recently changed lines

2018-06-09 Thread René Scharfe
Am 17.04.2018 um 23:30 schrieb Stefan Beller: > +static void parse_color_fields(const char *s) > +{ > + struct string_list l = STRING_LIST_INIT_DUP; > + struct string_list_item *item; > + enum { EXPECT_DATE, EXPECT_COLOR } next = EXPECT_COLOR; > + > + colorfield_nr = 0; > + > +

Re: [PATCH v8 1/2] json_writer: new routines to create data in JSON format

2018-06-08 Thread René Scharfe
Am 07.06.2018 um 16:12 schrieb g...@jeffhostetler.com: > Makefile| 2 + > json-writer.c | 419 > json-writer.h | 113 + > t/helper/test-json-writer.c | 572 >

Re: [PATCH v8 1/2] json_writer: new routines to create data in JSON format

2018-06-08 Thread René Scharfe
Am 07.06.2018 um 16:12 schrieb g...@jeffhostetler.com: > From: Jeff Hostetler > +/* > + * Add comma if we have already seen a member at this level. > + */ > +static inline void maybe_add_comma(struct json_writer *jw) > +{ > + if (!jw->open_stack.len) > + return; This is impossible

Re: [PATCH v8 1/2] json_writer: new routines to create data in JSON format

2018-06-07 Thread René Scharfe
le encode such strings) in the future. > > The initial use for the json-writer routines is for generating telemetry > data for executed Git commands. Later, we may want to use them in other > commands, such as status. > > Helped-by: René Scharfe > Helped-by:

Re: [PATCH 3/5] query_fsmonitor: use xsnprintf for formatting integers

2018-05-19 Thread René Scharfe
Am 19.05.2018 um 03:57 schrieb Jeff King: > These formatted integers should always fit into their > 64-byte buffers. Let's use xsnprintf() to add an assertion > that this is the case, which makes auditing for other > unchecked snprintfs() easier. How about this instead? -- >8 -- Subject: [PATCH]

Re: [PATCH] fast-export: avoid NULL pointer arithmetic

2018-05-15 Thread René Scharfe
Am 14.05.2018 um 03:37 schrieb Junio C Hamano: > René Scharfe writes: > >> Storing integer values in pointers is a trick that seems to have worked >> so far for fast-export. A portable way to avoid that trick without >> requiring more memory would be to use a union. &g

Re: [PATCH] fast-export: avoid NULL pointer arithmetic

2018-05-12 Thread René Scharfe
Am 12.05.2018 um 10:45 schrieb René Scharfe: > Or we could roll our own custom hash map, as I mused in an earlier post. > That would duplicate quite a bit of code; are there reusable pieces > hidden within that could be extracted into common functions? At least it would allow us to

Re: [PATCH v14 4/4] ls-remote: create '--sort' option

2018-05-12 Thread René Scharfe
Am 09.04.2018 um 03:42 schrieb Harald Nordgren: > diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh > index 02106c922..83cd35c39 100755 > --- a/t/t5512-ls-remote.sh > +++ b/t/t5512-ls-remote.sh > @@ -170,14 +206,18 @@ test_expect_success 'overrides work between mixed > transfer/upload-pack

Re: [PATCH] fast-export: avoid NULL pointer arithmetic

2018-05-12 Thread René Scharfe
Am 11.05.2018 um 19:42 schrieb Jeff King: > On Fri, May 11, 2018 at 03:34:19PM +0200, Duy Nguyen wrote: > >> On Fri, May 11, 2018 at 03:11:46PM +0200, Duy Nguyen wrote: >>> Back to fast-export, can we just allocate a new int on heap and point >>> it there? Allocating small pieces becomes quite che

Re: [PATCH] fast-export: avoid NULL pointer arithmetic

2018-05-10 Thread René Scharfe
Am 10.05.2018 um 12:51 schrieb Junio C Hamano: > René Scharfe writes: > >> The standard says about uintptr_t that "any valid pointer to void can >> be converted to this type, then converted back to pointer to void, and >> the result will compare equal to th

Re: [PATCH] fast-export: avoid NULL pointer arithmetic

2018-05-10 Thread René Scharfe
Am 09.05.2018 um 23:06 schrieb René Scharfe: > Clang 6 reports the following warning, which is turned into an error in a > DEVELOPER build: > > builtin/fast-export.c:162:28: error: performing pointer arithmetic on a > null pointer has undefined behavior [-Werror,-Wnull-poi

Re: [PATCH v5 5/7] builtin/grep.c: add '--column' option to 'git-grep(1)'

2018-05-09 Thread René Scharfe
Am 10.05.2018 um 02:04 schrieb Junio C Hamano: > Taylor Blau writes: > >> This check we should retain and change the wording to mention '--and', >> '--or', and '--not' specifically. > > Why are these problematic in the first place? If I said > > $ git grep -e first --and -e these > $

[PATCH] fast-export: avoid NULL pointer arithmetic

2018-05-09 Thread René Scharfe
Clang 6 reports the following warning, which is turned into an error in a DEVELOPER build: builtin/fast-export.c:162:28: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] return ((uint32_t *)NULL) + mark;

Re: [PATCH v4 2/7] grep.c: expose matched column in match_line()

2018-05-07 Thread René Scharfe
Am 05.05.2018 um 04:42 schrieb Taylor Blau: > When calling match_line(), callers presently cannot determine the > relative offset of the match because match_line() discards the > 'regmatch_t' that contains this information. > > Instead, teach match_line() to take in a 'regmatch_t *' so that caller

Re: [PATCH 5/6] builtin/grep.c: show column numbers via --column-number

2018-04-20 Thread René Scharfe
Am 21.04.2018 um 06:14 schrieb Junio C Hamano: > Junio C Hamano writes: > >> Taylor Blau writes: >> >>> This commit teaches 'git-grep(1)' a new option, '--column-number'. This >>> ... >>> +`columnnumber`;; >>> + column number prefix (when using `-m`) >> >> Is there other people's tool (preferr

Re: [PATCH 05/16] replace-object: eliminate replace objects prepared flag

2018-04-10 Thread René Scharfe
Am 10.04.2018 um 00:45 schrieb Stefan Beller: > By making the oidmap a pointer, we eliminate the need for > the global boolean variable 'replace_object_prepared'. > > Signed-off-by: Stefan Beller > --- > object-store.h | 2 +- > replace-object.c | 16 +--- > 2 files changed, 10

Re: [RFC PATCH 00/19] object-store refactoring 3 (replace objects, main ref store)

2018-04-06 Thread René Scharfe
Am 07.04.2018 um 01:21 schrieb Stefan Beller: > This applies on top of 464416a2eaadf84d2bfdf795007863d03b222b7c > (sb/packfiles-in-repository). > It is also available at > https://github.com/stefanbeller/git/tree/object-store-3 This series conflicts with 1731a1e239 (replace_object: convert struct

Re: [PATCH v2 2/2] builtin/config.c: prefer `--type=bool` over `--bool`, etc.

2018-03-29 Thread René Scharfe
Am 30.03.2018 um 07:28 schrieb Taylor Blau: > diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt > index e09ed5d7d..9956b03f7 100644 > --- a/Documentation/git-config.txt > +++ b/Documentation/git-config.txt > @@ -160,30 +158,34 @@ See also <>. > --list:: > List all var

Re: [PATCH] submodule: check for NULL return of get_submodule_ref_store()

2018-03-28 Thread René Scharfe
Am 28.03.2018 um 23:37 schrieb Stefan Beller: >> This looks nicer here in the script, but doesn't test exactly what users >> type most of the time, I suppose. >> >> So how about this? > > Looks good to me, though I had a nagging feeling at first that the > regex could be made more concise. > Why d

Re: [PATCH] submodule: check for NULL return of get_submodule_ref_store()

2018-03-28 Thread René Scharfe
Am 28.03.2018 um 22:21 schrieb Eric Sunshine: > On Wed, Mar 28, 2018 at 4:08 PM, Stefan Beller wrote: >> On Wed, Mar 28, 2018 at 11:57 AM, Eric Sunshine >> wrote: +test_expect_success 'moving the submodule does not break the superproject' ' + ( + cd addte

Re: [PATCH 4/3] sha1_name: use bsearch_pack() in unique_in_pack()

2018-03-25 Thread René Scharfe
Am 25.03.2018 um 18:19 schrieb Junio C Hamano: > René Scharfe writes: > >> Replace the custom binary search in unique_in_pack() with a call to >> bsearch_pack(). This reduces code duplication and makes use of the >> fan-out table of packs. >> >> Signed-off

[PATCH] unpack-trees: release oid_array after use in check_updates()

2018-03-25 Thread René Scharfe
Signed-off-by: Rene Scharfe --- That leak was introduced by c0c578b33c (unpack-trees: batch fetching of missing blobs). unpack-trees.c | 1 + 1 file changed, 1 insertion(+) diff --git a/unpack-trees.c b/unpack-trees.c index d5685891a5..e73745051e 100644 --- a/unpack-trees.c +++ b/unpack-trees.c

[PATCH] bisect: use oid_to_hex() for converting object_id hashes to hex strings

2018-03-25 Thread René Scharfe
Patch generated with Coccinelle and contrib/coccinelle/object_id.cocci. Signed-off-by: Rene Scharfe --- This is a belated follow-up to f0a6068a9f (bisect: debug: convert struct object to object_id). bisect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bisect.c b/bise

[PATCH] run-command: use strbuf_addstr() for adding a string to a strbuf

2018-03-25 Thread René Scharfe
Patch generated with Coccinelle and contrib/coccinelle/strbuf.cocci. Signed-off-by: Rene Scharfe --- That line was added by e73dd78699 (run-command.c: introduce trace_run_command()). run-command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-command.c b/run-command.c

Re: Null pointer dereference in git-submodule

2018-03-25 Thread René Scharfe
Am 25.03.2018 um 11:50 schrieb Jeremy Feusi: > > Hmm... That's weird. I can reproduce it on 3 independant systems with > versions 2.16.2 up, although it does not work with version 2.11.0. > Anyway, I figured out how to reproduce this bug. It is caused when a > submodule is added and then the direc

Re: Null pointer dereference in git-submodule

2018-03-24 Thread René Scharfe
Am 24.03.2018 um 18:42 schrieb Jeremy Feusi: > Hi, > While bootstrapping a gnu repository I noticed that git segfaulted when > called as "git submodule status". After compiling git with address > sanitizer and minimizing the directory I finally narrowed it down to the > files which I have attached

[PATCH 4/3] sha1_name: use bsearch_pack() in unique_in_pack()

2018-03-24 Thread René Scharfe
Replace the custom binary search in unique_in_pack() with a call to bsearch_pack(). This reduces code duplication and makes use of the fan-out table of packs. Signed-off-by: Rene Scharfe --- This is basically the same replacement as done by patch 3. Speed is less of a concern here -- at least I

Re: [PATCH v2] json_writer: new routines to create data in JSON format

2018-03-23 Thread René Scharfe
Am 23.03.2018 um 20:55 schrieb Jeff Hostetler: >>> +struct json_writer_level >>> +{ >>> +    unsigned level_is_array : 1; >>> +    unsigned level_is_empty : 1; >>> +}; >>> + >>> +struct json_writer >>> +{ >>> +    struct json_writer_level *levels; >>> +    int nr, alloc; >>> +    struct strbuf json

Re: [PATCH v2] json_writer: new routines to create data in JSON format

2018-03-23 Thread René Scharfe
Am 21.03.2018 um 20:28 schrieb g...@jeffhostetler.com: > From: Jeff Hostetler > > Add basic routines to generate data in JSON format. > > Signed-off-by: Jeff Hostetler > --- > Makefile| 2 + > json-writer.c | 321 + > json-

Re: [PATCH] fetch-pack.c: use oidset to check existence of loose object

2018-03-08 Thread René Scharfe
Am 08.03.2018 um 13:06 schrieb Takuto Ikuta: > In repository having large number of refs, lstat for non-existing loose > objects makes `git fetch` slow. > > This patch stores existing loose objects in hashmap beforehand and use > it to check existence instead of using lstat. > > With this patch,

Re: [PATCH] xdiff: improve trimming preprocessing

2018-03-07 Thread René Scharfe
Am 07.03.2018 um 10:36 schrieb Eric Sunshine: > On Tue, Mar 6, 2018 at 6:05 PM, Jun Wu wrote: >> Excerpts from Eric Sunshine's message of 2018-03-06 14:23:46 -0500: >>> On Tue, Mar 6, 2018 at 6:53 AM, Jun Wu wrote: + printf "x%.0s" {1..934} >>d # pad common suffix to 1024 bytes >>> >>> The

Re:

2018-02-27 Thread René Scharfe
Am 27.02.2018 um 02:18 schrieb Alan Gage: > Hello, I recently noticed a bug involving GitBash and Python. I was > running a function that would post the system time once every second > using a while loop but the text was only sent after the while loop > ended due to a timer I had set. Essesntially,

[PATCH] perf: use GIT_PERF_REPEAT_COUNT=3 by default even without config file

2018-02-25 Thread René Scharfe
9ba95ed23c (perf/run: update get_var_from_env_or_config() for subsections) stopped setting a default value for GIT_PERF_REPEAT_COUNT if no perf config file is present, because get_var_from_env_or_config returns early in that case. Fix it by setting the default value after calling this function. I

Re: [PATCH] commit-graph: fix some "plain integer as NULL pointer" warnings

2018-02-23 Thread René Scharfe
Am 24.02.2018 um 03:24 schrieb Ramsay Jones: > diff --git a/commit-graph.c b/commit-graph.c > index fc5ee7e99..c2f443436 100644 > --- a/commit-graph.c > +++ b/commit-graph.c > @@ -45,7 +45,7 @@ char *get_graph_latest_filename(const char *obj_dir) > { > struct strbuf fname = STRBUF_INIT; >

Re: [PATCH] strbuf_read_file(): preserve errno across close() call

2018-02-23 Thread René Scharfe
Am 23.02.2018 um 23:17 schrieb Junio C Hamano: > René Scharfe writes: > >> +#define IGNORE_ERROR(expr) do { int e_ = errno; expr; errno = e_; } while >> (0) > > The macro certainly is a cute idea, but ... > >> @@ -391,7 +393,7 @@ ssize_t strbuf_read(struct st

Re: [PATCH] strbuf_read_file(): preserve errno across close() call

2018-02-23 Thread René Scharfe
Am 23.02.2018 um 08:00 schrieb Jeff King: > On Fri, Feb 23, 2018 at 01:49:52AM -0500, Jeff King wrote: > Subject: [PATCH] strbuf_read_file(): preserve errno across close() call > > If we encounter a read error, the user may want to report it > by looking at errno. However, our close() call may clo

[PATCH] sequencer: factor out strbuf_read_file_or_whine()

2018-02-22 Thread René Scharfe
Reduce code duplication by factoring out a function that reads an entire file into a strbuf, or reports errors on stderr if something goes wrong. Signed-off-by: Rene Scharfe --- The difference to using strbuf_read_file() is more detailed error messages for open(2) failures. But I don't know if w

Re: [PATCH 003/194] object-store: move packed_git and packed_git_mru to object store

2018-02-13 Thread René Scharfe
Am 12.02.2018 um 22:48 schrieb Junio C Hamano: > René Scharfe writes: > >> Am 12.02.2018 um 22:04 schrieb Junio C Hamano: >>> Stefan Beller writes: >>> >>>> I thought it may be a helpful >>>> for merging this series with the rest of the e

Re: [PATCH 003/194] object-store: move packed_git and packed_git_mru to object store

2018-02-12 Thread René Scharfe
[removed rene.scha...@lsrfire.ath.cx from cc:; I lost that domain a few years ago. Thanks for the heads-up, Stefan!] Am 12.02.2018 um 20:00 schrieb Stefan Beller: > On Fri, Feb 9, 2018 at 2:09 PM, Junio C Hamano wrote: >> Stefan Beller writes: >> >>> Patch generated by >>> >>> 2. Applying th

Re: [PATCH 003/194] object-store: move packed_git and packed_git_mru to object store

2018-02-12 Thread René Scharfe
Am 12.02.2018 um 22:04 schrieb Junio C Hamano: > Stefan Beller writes: > >> I thought it may be a helpful >> for merging this series with the rest of the evolved code base which >> may make use of one of the converted functions. So instead of fixing >> that new instance manually, cocinelle could

[PATCH] check-ignore: fix mix of directories and other file types

2018-02-10 Thread René Scharfe
In check_ignore(), the first pathspec item determines the dtype for any subsequent ones. That means that a pathspec matching a regular file can prevent following pathspecs from matching directories, which makes no sense. Fix that by determining the dtype for each pathspec separately, by passing t

Re: [PATCH 2/2] packfile: refactor hash search with fanout table

2018-02-09 Thread René Scharfe
Am 02.02.2018 um 23:36 schrieb Jonathan Tan: > Subsequent patches will introduce file formats that make use of a fanout > array and a sorted table containing hashes, just like packfiles. > Refactor the hash search in packfile.c into its own function, so that > those patches can make use of it as we

Re: [PATCH] cocci: simplify check for trivial format strings

2018-02-02 Thread René Scharfe
Am 02.02.2018 um 15:34 schrieb SZEDER Gábor: > On Thu, Feb 1, 2018 at 7:56 PM, René Scharfe wrote: >> 353d84c537 (coccicheck: make transformation for strbuf_addf(sb, "...") >> more precise) added a check to avoid transforming calls with format >> strings which conta

[PATCH] cocci: simplify check for trivial format strings

2018-02-01 Thread René Scharfe
353d84c537 (coccicheck: make transformation for strbuf_addf(sb, "...") more precise) added a check to avoid transforming calls with format strings which contain percent signs, as that would change the result. It uses embedded Python code for that. Simplify this rule by using the regular expression

Re: [PATCH v3] mru: Replace mru.[ch] with list.h implementation

2018-01-20 Thread René Scharfe
Am 20.01.2018 um 23:24 schrieb Gargi Sharma: > On Sat, Jan 20, 2018 at 1:02 AM, Eric Wong wrote: >> Gargi Sharma wrote: >>> --- a/list.h >>> +++ b/list.h >>> @@ -93,6 +93,13 @@ static inline void list_move(struct list_head *elem, >>> struct list_head *head) >>>list_add(elem, head); >>>

Re: [PATCH v2 2/6] Add tar extract install options override in installation processing.

2018-01-20 Thread René Scharfe
Am 20.01.2018 um 14:44 schrieb Randall S. Becker: > On January 20, 2018 7:31 AM, René Scharfe wrote: >> Am 19.01.2018 um 18:34 schrieb randall.s.bec...@rogers.com: >>> From: "Randall S. Becker" >>> >>> * Makefile: Add TAR_EXTRACT_OPTIONS to allow

Re: [PATCH v2 2/6] Add tar extract install options override in installation processing.

2018-01-20 Thread René Scharfe
Am 19.01.2018 um 18:34 schrieb randall.s.bec...@rogers.com: > From: "Randall S. Becker" > > * Makefile: Add TAR_EXTRACT_OPTIONS to allow platform options to be >specified if needed. The default is xof. > > Signed-off-by: Randall S. Becker > --- > Makefile | 6 +- > 1 file changed, 5

Re: [PATCH] describe: use strbuf_add_unique_abbrev() for adding short hashes

2018-01-19 Thread René Scharfe
Am 18.01.2018 um 23:40 schrieb SZEDER Gábor: > On Thu, Jan 18, 2018 at 10:40 PM, René Scharfe wrote: >> Am 16.01.2018 um 18:11 schrieb SZEDER Gábor: >>> Unfortunately, most of the changes coming from 'strbuf.cocci' don't >>> make any sense, they ap

[PATCH] cocci: use format keyword instead of a literal string

2018-01-19 Thread René Scharfe
There's a rule in strbuf.cocci for converting trivial uses of strbuf_addf() to strbuf_addstr() in order to simplify the code and improve performance a bit. Coccinelle 1.0.0~rc19.deb-3 on Travis CI lets the "%s" in that rule match format strings like "%d" as well for some reason, though, leading to

Re: [PATCH] describe: use strbuf_add_unique_abbrev() for adding short hashes

2018-01-18 Thread René Scharfe
Am 16.01.2018 um 18:11 schrieb SZEDER Gábor: > Unfortunately, most of the changes coming from 'strbuf.cocci' don't > make any sense, they appear to be the mis-application of the "use > strbuf_addstr() instead of strbuf_addf() to add a single string" rule: > >- strbuf_addf(&sb_repo,

[PATCH] describe: use strbuf_add_unique_abbrev() for adding short hashes

2018-01-15 Thread René Scharfe
Call strbuf_add_unique_abbrev() to add an abbreviated hash to a strbuf instead of taking a detour through find_unique_abbrev() and its static buffer. This is shorter and a bit more efficient. Patch generated by Coccinelle (and contrib/coccinelle/strbuf.cocci). Signed-off-by: Rene Scharfe --- Th

unused variable in hashmap.h [was: Re: [PATCH] Fixed pervasive enumeration warning in convert.h.]

2018-01-13 Thread René Scharfe
Am 12.01.2018 um 20:52 schrieb Randall S. Becker: > On a related too many warnings subject, hashmap.h has a variable > unused (void *item). Is that addressed soon? If not, I can deal with > it. Here are the code lines containing the variable in question: void *item; while ((item =

Re: [PATCH v2 4/9] object: add clear_commit_marks_all()

2018-01-11 Thread René Scharfe
Am 10.01.2018 um 08:58 schrieb Jeff King: > On Mon, Dec 25, 2017 at 06:44:58PM +0100, René Scharfe wrote: > >> Add a function for clearing the commit marks of all in-core commit >> objects. It's similar to clear_object_flags(), but more precise, since >> it leaves

Re: [PATCH v2 5/9] bisect: avoid using the rev_info flag leak_pending

2018-01-11 Thread René Scharfe
Am 10.01.2018 um 09:07 schrieb Jeff King: > On Mon, Dec 25, 2017 at 06:45:36PM +0100, René Scharfe wrote: > >> The leak_pending flag is so awkward to use that multiple comments had to >> be added around each occurrence. We only use it for remembering the >> commits whos

Re: [PATCH] bisect: avoid NULL pointer dereference

2018-01-08 Thread René Scharfe
Hello Dscho, Am 08.01.2018 um 21:45 schrieb Johannes Schindelin: > Isn't this identical to > https://public-inbox.org/git/20180103184852.27271-1-ava...@gmail.com/ ? yes, indeed, thanks. So here's an upvote for Ævar's patch then. :) (I should have sent it earlier, but was not fully convinced it

[PATCH] bisect: avoid NULL pointer dereference

2018-01-08 Thread René Scharfe
7c117184d7 (bisect: fix off-by-one error in `best_bisection_sorted()`) fixed an off-by-one error, plugged a memory leak and removed a NULL check. However, the pointer p *is* actually NULL if an empty list is passed to the function. Let's add the check back for safety. Bisecting nothing doesn't m

Re: [PATCH] git-archive: accept --owner and --group like GNU tar

2018-01-05 Thread René Scharfe
Am 04.01.2018 um 19:22 schrieb Junio C Hamano: > René Scharfe writes: > >> I don't know if it's a good idea, but perhaps we don't even need a new >> option. We could change how pathspecs of untracked files are handled: >> Instead of aborting we could inc

Re: [PATCH] git-archive: accept --owner and --group like GNU tar

2018-01-04 Thread René Scharfe
Am 04.01.2018 um 03:25 schrieb suzuki toshiya: > Taking a glance on parse-options.h, I could not find the > existing class collecting the operands as an array (or > linked list) from multiple "--xxx=yyy" options. Similar > things might be the collecting the pathnames to pathspec > structure. Should

Re: [PATCH] git-archive: accept --owner and --group like GNU tar

2018-01-03 Thread René Scharfe
[replying only to the list because emails to per...@pluto.rain.com are rejected by my mail server with the following error message: "Requested action not taken: mailbox unavailable invalid DNS MX or A/ resource record."] Am 02.01.2018 um 01:32 schrieb Perry Hutchison: > Ren?? Scharfe wrot

Re: [PATCH] git-archive: accept --owner and --group like GNU tar

2018-01-02 Thread René Scharfe
Am 02.01.2018 um 07:58 schrieb suzuki toshiya: > Dear René , > > René Scharfe wrote: >> Am 29.12.2017 um 15:05 schrieb suzuki toshiya: >>> The ownership of files created by git-archive is always >>> root:root. Add --owner and --group options which work >>

Re: [PATCH] git-archive: accept --owner and --group like GNU tar

2018-01-01 Thread René Scharfe
Am 29.12.2017 um 15:05 schrieb suzuki toshiya: > The ownership of files created by git-archive is always > root:root. Add --owner and --group options which work > like the GNU tar equivalent to allow overriding these > defaults. In which situations do you use the new options? (The sender would ne

[PATCH v2 9/9] commit: remove unused function clear_commit_marks_for_object_array()

2017-12-25 Thread René Scharfe
Signed-off-by: Rene Scharfe --- commit.c | 14 -- commit.h | 1 - 2 files changed, 15 deletions(-) diff --git a/commit.c b/commit.c index 9edc12f338..ff51c9f34a 100644 --- a/commit.c +++ b/commit.c @@ -559,20 +559,6 @@ void clear_commit_marks(struct commit *commit, unsigned int mar

[PATCH v2 8/9] revision: remove the unused flag leak_pending

2017-12-25 Thread René Scharfe
Signed-off-by: Rene Scharfe --- revision.c | 3 +-- revision.h | 12 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/revision.c b/revision.c index f6a3da5cd9..7239315de9 100644 --- a/revision.c +++ b/revision.c @@ -2860,8 +2860,7 @@ int prepare_revision_walk(struct re

[PATCH v2 7/9] checkout: avoid using the rev_info flag leak_pending

2017-12-25 Thread René Scharfe
The leak_pending flag is so awkward to use that multiple comments had to be added around each occurrence. We only use it for remembering the commits whose marks we have to clear after checking if the old HEAD is detached. This is easy, though: We need to do that for the old commit, the new one --

[PATCH v2 5/9] bisect: avoid using the rev_info flag leak_pending

2017-12-25 Thread René Scharfe
The leak_pending flag is so awkward to use that multiple comments had to be added around each occurrence. We only use it for remembering the commits whose marks we have to clear after checking if all of the good ones are ancestors of the bad one. This is easy, though: We need to do that for the b

[PATCH v2 6/9] bundle: avoid using the rev_info flag leak_pending

2017-12-25 Thread René Scharfe
The leak_pending flag is so awkward to use that multiple comments had to be added around each occurrence. We use it for remembering the prerequisites for the bundle. That is easy, though: We have the ref_list named "prerequisites" in the header for just that purpose. Use this original list of pr

[PATCH v2 4/9] object: add clear_commit_marks_all()

2017-12-25 Thread René Scharfe
Add a function for clearing the commit marks of all in-core commit objects. It's similar to clear_object_flags(), but more precise, since it leaves the other object types alone. It still has to iterate through them, though. Signed-off-by: Rene Scharfe --- object.c | 11 +++ object.h |

[PATCH v2 3/9] ref-filter: use clear_commit_marks_many() in do_merge_filter()

2017-12-25 Thread René Scharfe
Signed-off-by: Rene Scharfe --- ref-filter.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 3f9161707e..f9e25aea7a 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -1995,8 +1995,7 @@ static void do_merge_filter(struct ref_filter_cbdata *ref

[PATCH v2 1/9] commit: avoid allocation in clear_commit_marks_many()

2017-12-25 Thread René Scharfe
Pass the entries of the commit array directly to clear_commit_marks_1() instead of adding them to a commit_list first. The function clears the commit and any first parent without allocation; only higher numbered parents are added to a list for later treatment. This change extends that optimizatio

<    1   2   3   4   5   6   7   8   9   10   >