Re: git clean -fdx deletes tracked files

2017-08-15 Thread Kim Birkelund
Apologies. I should obviously have mentioned which OSes the machines I tested on ran. One Windows 10 (fully updated) and one Windows Server 2016 (also updated). I've also seen it in a real repository on our build server which is Windows Server 2012 R2. After my first mail I updated git to latest

Re: reftable [v7]: new ref storage format

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 7:48 PM, Shawn Pearce wrote: > 7th iteration of the reftable storage format. > > You can read a rendered version of this here: > https://googlers.googlesource.com/sop/jgit/+/reftable/Documentation/technical/reftable.md > > Changes from v6: > - Blocks are variable sized, and

Re: [PATCH v4 0/3] "diff --color-moved" with yet another heuristic

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 6:27 PM, Jonathan Tan wrote: > These patches are on sb/diff-color-move. > > Patches 1 and 2 are unchanged, except for some line wrapping in a test > in patch 2. > > This has been updated to use the same alphanumeric heuristic as blame > (20 alnum characters). I tried it out

Re: [PATCH] push: do not add submodule odb as an alternate when recursing on demand

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 7:08 PM, Jonathan Nieder wrote: > Hi, > > Stefan Beller wrote: >> On Tue, Aug 15, 2017 at 5:11 PM, Junio C Hamano wrote: >>> Stefan Beller writes: Junio C Hamano wrote: > > Is "is it populated" a good thing to check here, though? IIRC, > add-submodule-odb al

[PATCH] fix revisions doc about quoting for ':/' notation

2017-08-15 Thread ryenus
To make sure the `` in `:/` is seen as one search string, one should quote/escape `` properly. Especially, the example given in the manual `:/fix nasty bug` does not work because of missing quotes. The examples are now corrected, and a note about quoting/escaping is added as well. --- Documentati

Re: reftable [v7]: new ref storage format

2017-08-15 Thread Shawn Pearce
7th iteration of the reftable storage format. You can read a rendered version of this here: https://googlers.googlesource.com/sop/jgit/+/reftable/Documentation/technical/reftable.md Changes from v6: - Blocks are variable sized, and alignment is optional. - ref index is required on variable sized

Re: [PATCH] push: do not add submodule odb as an alternate when recursing on demand

2017-08-15 Thread Jonathan Nieder
Hi, Stefan Beller wrote: > On Tue, Aug 15, 2017 at 5:11 PM, Junio C Hamano wrote: >> Stefan Beller writes: >>> Junio C Hamano wrote: Is "is it populated" a good thing to check here, though? IIRC, add-submodule-odb allows you to add the object database of an inactivated submodule

[PATCH v4 3/3] diff: define block by number of alphanumeric chars

2017-08-15 Thread Jonathan Tan
The existing behavior of diff --color-moved=zebra does not define the minimum size of a block at all, instead relying on a heuristic applied later to filter out sets of adjacent moved lines that are shorter than 3 lines long. This can be confusing, because a block could thus be colored as moved at

[PATCH v4 2/3] diff: respect MIN_BLOCK_LENGTH for last block

2017-08-15 Thread Jonathan Tan
Currently, MIN_BLOCK_LENGTH is only checked when diff encounters a line that does not belong to the current block. In particular, this means that MIN_BLOCK_LENGTH is not checked after all lines are encountered. Perform that check. Signed-off-by: Jonathan Tan --- diff.c | 29

[PATCH v4 1/3] diff: avoid redundantly clearing a flag

2017-08-15 Thread Jonathan Tan
No code in diff.c sets DIFF_SYMBOL_MOVED_LINE except in mark_color_as_moved(), so it is redundant to clear it for the current line. Therefore, clear it only for previous lines. This makes a refactoring in a subsequent patch easier. Signed-off-by: Jonathan Tan --- diff.c | 2 +- 1 file changed,

[PATCH v4 0/3] "diff --color-moved" with yet another heuristic

2017-08-15 Thread Jonathan Tan
These patches are on sb/diff-color-move. Patches 1 and 2 are unchanged, except for some line wrapping in a test in patch 2. This has been updated to use the same alphanumeric heuristic as blame (20 alnum characters). I tried it out and I thought the results were reasonable in a patch set that I'm

Re: [PATCH] convert add_to_alternates_file to use repository struct

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 6:04 PM, Brandon Williams wrote: > On 08/15, Stefan Beller wrote: >> The long term plan is to move most functionality to be included via >> the repository struct, starting somewhere, convert add_to_alternates_file >> in this patch, which has link_alt_odb_entries, which is c

Re: [PATCH] push: do not add submodule odb as an alternate when recursing on demand

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 5:11 PM, Junio C Hamano wrote: > Stefan Beller writes: > >>> Is "is it populated" a good thing to check here, though? IIRC, >>> add-submodule-odb allows you to add the object database of an >>> inactivated submodule, so this seems to change the behaviour. I do >>> not kn

Re: [PATCH] convert add_to_alternates_file to use repository struct

2017-08-15 Thread Brandon Williams
On 08/15, Stefan Beller wrote: > The long term plan is to move most functionality to be included via > the repository struct, starting somewhere, convert add_to_alternates_file > in this patch, which has link_alt_odb_entries, which is converted, too. > Any caller outside add_to_alternates_file, jus

[PATCH] convert add_to_alternates_file to use repository struct

2017-08-15 Thread Stefan Beller
The long term plan is to move most functionality to be included via the repository struct, starting somewhere, convert add_to_alternates_file in this patch, which has link_alt_odb_entries, which is converted, too. Any caller outside add_to_alternates_file, just uses `the_repository` as the reposito

[RFC PATCH] Updated "imported object" design

2017-08-15 Thread Jonathan Tan
This patch is based on an updated version of my refactoring of pack-related functions [1]. This corresponds to patch 1 of my previous series [2]. I'm sending this patch out (before I update the rest) for 2 reasons: * to provide a demonstration of how the feature could be implemented, in the ho

Re: [PATCH] sub-process: print the cmd when a capability is unsupported

2017-08-15 Thread Jonathan Nieder
Jonathan Tan wrote: > Christian Couder wrote: >> In handshake_capabilities() we use warning() when a capability >> is not supported, so the exit code of the function is 0 and no >> further error is shown. This is a problem because the warning >> message doesn't tell us which subprocess cmd failed

Re: [PATCH] push: do not add submodule odb as an alternate when recursing on demand

2017-08-15 Thread Junio C Hamano
Stefan Beller writes: >> Is "is it populated" a good thing to check here, though? IIRC, >> add-submodule-odb allows you to add the object database of an >> inactivated submodule, so this seems to change the behaviour. I do >> not know if the behaviour change is a good thing (i.e. bugfix) or >>

Re: [PATCH] push: do not add submodule odb as an alternate when recursing on demand

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 4:23 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> "git push --recurse-submodules=on-demand" adds each submodule as an >> alternate with add_submodule_odb before checking whether the >> submodule has anything to push and pushing it if so. >> >> However, it never a

Re: [PATCH] push: do not add submodule odb as an alternate when recursing on demand

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 4:14 PM, Jonathan Nieder wrote: > Stefan Beller wrote: > >> Use is_submodule_populated_gently instead, which is simpler and >> cheaper. > [...] >> --- a/submodule.c >> +++ b/submodule.c >> @@ -966,7 +966,9 @@ static int push_submodule(const char *path, >>

Re: [PATCH] push: do not add submodule odb as an alternate when recursing on demand

2017-08-15 Thread Junio C Hamano
Stefan Beller writes: > "git push --recurse-submodules=on-demand" adds each submodule as an > alternate with add_submodule_odb before checking whether the > submodule has anything to push and pushing it if so. > > However, it never accesses any objects from the submodule. > ... > Use is_submodule

Re: [PATCH] push: do not add submodule odb as an alternate when recursing on demand

2017-08-15 Thread Jonathan Nieder
Stefan Beller wrote: > Use is_submodule_populated_gently instead, which is simpler and > cheaper. [...] > --- a/submodule.c > +++ b/submodule.c > @@ -966,7 +966,9 @@ static int push_submodule(const char *path, > const struct string_list *push_options, >

Re: [PATCH] push: do not add submodule odb as an alternate when recursing on demand

2017-08-15 Thread Jonathan Nieder
Stefan Beller wrote: > "git push --recurse-submodules=on-demand" adds each submodule as an > alternate with add_submodule_odb before checking whether the > submodule has anything to push and pushing it if so. > > However, it never accesses any objects from the submodule. In the > parent process i

[GSoC] Update: Week-13

2017-08-15 Thread Prathamesh Chavan
SUMMARY OF MY PROJECT: Git submodule subcommands are currently implemented by using shell script 'git-submodule.sh'. There are several reasons why we'll prefer not to use the shell script. My project intends to convert the subcommands into C code, thus making them builtins. This will increase Git'

Re: reftable [v6]: new ref storage format

2017-08-15 Thread Shawn Pearce
On Mon, Aug 14, 2017 at 5:13 AM, Michael Haggerty wrote: > On 08/07/2017 03:47 AM, Shawn Pearce wrote: >> 6th iteration of the reftable storage format. > > Thanks! > >> Changes from v5: >> - extensions.refStorage = reftable is used to select this format. >> >> - Log records can be explicitly delet

Re: [PATCH/RFC] git-grep: correct exit code with --quiet and -L

2017-08-15 Thread Anthony Sottile
Sounds good, I'll wait. I've also created a mailing list entry on the gnu grep mailing list as I believe the current exit status for --files-without-match is inconsistent: http://lists.gnu.org/archive/html/bug-grep/2017-08/msg00010.html Anthony On Tue, Aug 15, 2017 at 3:24 PM, Junio C Hamano w

[PATCH] push: do not add submodule odb as an alternate when recursing on demand

2017-08-15 Thread Stefan Beller
"git push --recurse-submodules=on-demand" adds each submodule as an alternate with add_submodule_odb before checking whether the submodule has anything to push and pushing it if so. However, it never accesses any objects from the submodule. In the parent process it uses the submodule's ref databa

Re: [PATCH/RFC] git-grep: correct exit code with --quiet and -L

2017-08-15 Thread Junio C Hamano
Anthony Sottile writes: > Ah yes, I didn't intend to include the first hunk (forgot to amend it > out when formatting the patch). > > I think git's exit codes for -L actually make more sense than the GNU > exit codes (especially when comparing with `grep` vs `grep -v`) -- > that is, produce `0` w

Re: Bug: `git remote show ` reports different HEAD branch than refs/remotes//HEAD

2017-08-15 Thread Jeff King
On Tue, Aug 15, 2017 at 01:58:38PM -0400, Jason Karns wrote: > > On the other hand, what "git remote show" outputs for HEAD is a name > > of actually checked-out branch inside that remote repository - it`s > > what`s stored inside HEAD file of the remote repository root. > > > > So it is something

Re: [PATCH/RFC] git-grep: correct exit code with --quiet and -L

2017-08-15 Thread Anthony Sottile
Ah yes, I didn't intend to include the first hunk (forgot to amend it out when formatting the patch). I think git's exit codes for -L actually make more sense than the GNU exit codes (especially when comparing with `grep` vs `grep -v`) -- that is, produce `0` when the search is successful (produci

INVESTMENT

2017-08-15 Thread MARIA Bob
INVESTMENT You may be surprised to receive my letter, however,I have decided to contact you for confidential, Urgent and rewarding joint business. My name is Mrs. MARIA Bob was a Personal Assistant to the Late Libyan President, Muammar Gaddafi, who was Killed in 20 October 2011 and my aim of writin

Re: [PATCH] sha1_file: make read_info_alternates static

2017-08-15 Thread Jeff King
On Tue, Aug 15, 2017 at 01:13:19PM -0700, Stefan Beller wrote: > read_info_alternates is not used from outside, so let's make it static. > > We have to declare the function before link_alt_odb_entry instead of > moving the code around, link_alt_odb_entry calls read_info_alternates, > which in tur

Re: [PATCH/RFC] git-grep: correct exit code with --quiet and -L

2017-08-15 Thread Junio C Hamano
Anthony Sottile writes: > The handling of `status_only` no longer interferes with the handling of > `unmatch_name_only`. `--quiet` no longer affects the exit code when using > `-L`/`--files-without-match`. I agree with the above statement of yours that --quiet should not affect what the exit st

Re: [PATCH] sha1_file: make read_info_alternates static

2017-08-15 Thread Brandon Williams
On 08/15, Stefan Beller wrote: > read_info_alternates is not used from outside, so let's make it static. > > We have to declare the function before link_alt_odb_entry instead of > moving the code around, link_alt_odb_entry calls read_info_alternates, > which in turn calls link_alt_odb_entry. > >

Re: [PATCH v3 3/3] diff: define block by number of non-space chars

2017-08-15 Thread Junio C Hamano
Stefan Beller writes: > The function blame_entry_score is documented to approach > this exact problem that we are trying to solve here, so I agree > we should have a common heuristic. While I do not think it is necessary to do such a refactoring within the scope of this series, we should at leas

[PATCH/RFC] git-grep: correct exit code with --quiet and -L

2017-08-15 Thread Anthony Sottile
The handling of `status_only` no longer interferes with the handling of `unmatch_name_only`. `--quiet` no longer affects the exit code when using `-L`/`--files-without-match`. Signed-off-by: Anthony Sottile --- grep.c | 9 + t/t7810-grep.sh | 5 + 2 files changed, 10 insert

Re: tsan: t3008: hashmap_add touches size from multiple threads

2017-08-15 Thread Jeff Hostetler
On 8/15/2017 3:21 PM, Martin Ågren wrote: On 15 August 2017 at 20:48, Stefan Beller wrote: /* total number of entries (0 means the hashmap is empty) */ - unsigned int size; + /* -1 means size is unknown for threading reasons */ + int size; This double-encodes the

Re: [PATCH] sub-process: print the cmd when a capability is unsupported

2017-08-15 Thread Christian Couder
On Tue, Aug 15, 2017 at 9:35 PM, Lars Schneider wrote: > >> On 15 Aug 2017, at 21:29, Christian Couder >> wrote: >> >> On Tue, Aug 15, 2017 at 9:00 PM, Lars Schneider >> wrote: >>> >>> Wouldn't it be possible to use "process->argv[0]"? >>> Shouldn't that be the same as "cmd"? >> >> Well in sub-

[PATCH] sha1_file: make read_info_alternates static

2017-08-15 Thread Stefan Beller
read_info_alternates is not used from outside, so let's make it static. We have to declare the function before link_alt_odb_entry instead of moving the code around, link_alt_odb_entry calls read_info_alternates, which in turn calls link_alt_odb_entry. Signed-off-by: Stefan Beller --- This hel

Re: [PATCH v3 3/3] diff: define block by number of non-space chars

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 12:54 PM, Junio C Hamano wrote: > Jonathan Tan writes: > >> The existing behavior of diff --color-moved=zebra does not define the >> minimum size of a block at all, instead relying on a heuristic applied >> later to filter out sets of adjacent moved lines that are shorter

Re: [PATCH v3 3/3] diff: define block by number of non-space chars

2017-08-15 Thread Junio C Hamano
Jonathan Tan writes: > The existing behavior of diff --color-moved=zebra does not define the > minimum size of a block at all, instead relying on a heuristic applied > later to filter out sets of adjacent moved lines that are shorter than 3 > lines long. This can be confusing, because a block cou

Re: [PATCH 2/5] pack-objects: take lock before accessing `remaining`

2017-08-15 Thread Johannes Sixt
Am 15.08.2017 um 14:53 schrieb Martin Ågren: When checking the conditional of "while (me->remaining)", we did not hold the lock. Calling find_deltas would still be safe, since it checks "remaining" (after taking the lock) and is able to handle all values. In fact, this could (currently) not trigg

Re: [PATCH] sub-process: print the cmd when a capability is unsupported

2017-08-15 Thread Lars Schneider
> On 15 Aug 2017, at 21:29, Christian Couder wrote: > > On Tue, Aug 15, 2017 at 9:00 PM, Lars Schneider > wrote: >> >>> On 15 Aug 2017, at 19:36, Christian Couder >>> wrote: >>> >>> In handshake_capabilities() we use warning() when a capability >>> is not supported, so the exit code of the

Re: [PATCH] sub-process: print the cmd when a capability is unsupported

2017-08-15 Thread Christian Couder
On Tue, Aug 15, 2017 at 9:29 PM, Christian Couder wrote: > On Tue, Aug 15, 2017 at 9:00 PM, Lars Schneider > wrote: >> >>> On 15 Aug 2017, at 19:36, Christian Couder >>> wrote: >>> @@ -184,8 +185,8 @@ static int handshake_capabilities(struct child_process >>> *process, >>>

Re: [PATCH] sub-process: print the cmd when a capability is unsupported

2017-08-15 Thread Christian Couder
On Tue, Aug 15, 2017 at 9:00 PM, Lars Schneider wrote: > >> On 15 Aug 2017, at 19:36, Christian Couder >> wrote: >> >> In handshake_capabilities() we use warning() when a capability >> is not supported, so the exit code of the function is 0 and no >> further error is shown. This is a problem bec

Re: [PATCH] sub-process: print the cmd when a capability is unsupported

2017-08-15 Thread Junio C Hamano
Lars Schneider writes: >> On 15 Aug 2017, at 19:36, Christian Couder >> wrote: >> >> In handshake_capabilities() we use warning() when a capability >> is not supported, so the exit code of the function is 0 and no >> further error is shown. This is a problem because the warning >> message does

Re: git clean -fdx deletes tracked files

2017-08-15 Thread Kevin Daudt
On Tue, Aug 15, 2017 at 08:45:20PM +0200, Kim Birkelund wrote: > Hi > > I hope this is gonna sound as weird to you as it does to me. > > The link below is a zip of a small git repository that I can reproduce > the bug in on 2 machines. > > Repo: https://www.dropbox.com/s/fz4d0i5ko7s7ktr/test.zip

Re: tsan: t3008: hashmap_add touches size from multiple threads

2017-08-15 Thread Martin Ågren
On 15 August 2017 at 20:48, Stefan Beller wrote: /* total number of entries (0 means the hashmap is empty) */ - unsigned int size; + /* -1 means size is unknown for threading reasons */ + int size; >>> >>> This double-encodes the state of disallow_reha

Re: [PATCH 4/5] strbuf_reset: don't write to slopbuf with ThreadSanitizer

2017-08-15 Thread Junio C Hamano
Martin Ågren writes: >> diff --git a/strbuf.h b/strbuf.h >> index 2075384e0b..1a77fe146a 100644 >> --- a/strbuf.h >> +++ b/strbuf.h >> @@ -147,7 +147,10 @@ static inline void strbuf_setlen(struct strbuf *sb, >> size_t len) >> if (len > (sb->alloc ? sb->alloc - 1 : 0)) >>

Re: [PATCH 4/5] strbuf_reset: don't write to slopbuf with ThreadSanitizer

2017-08-15 Thread Martin Ågren
On 15 August 2017 at 20:43, Junio C Hamano wrote: > Martin Ågren writes: > >> If two threads have one freshly initialized string buffer each and call >> strbuf_reset on them at roughly the same time, both threads will be >> writing a '\0' to strbuf_slopbuf. That is not a problem in practice >> si

Re: [PATCH 2/5] sha1_file: fix hardcoded size in null_sha1

2017-08-15 Thread Junio C Hamano
Stefan Beller writes: > Once we have 2 hash functions usable in a local Git installation, > this would be wasteful for the smaller hash function (and the > related grafts). > > I think Jonathan once envisioned an 'optimized' version as a > second step, maybe this is a good time to discuss how we'

Re: [PATCH] sub-process: print the cmd when a capability is unsupported

2017-08-15 Thread Ben Peart
On 8/15/2017 1:36 PM, Christian Couder wrote: In handshake_capabilities() we use warning() when a capability is not supported, so the exit code of the function is 0 and no further error is shown. This is a problem because the warning message doesn't tell us which subprocess cmd failed. On the

Re: [PATCH] sub-process: print the cmd when a capability is unsupported

2017-08-15 Thread Lars Schneider
> On 15 Aug 2017, at 19:36, Christian Couder wrote: > > In handshake_capabilities() we use warning() when a capability > is not supported, so the exit code of the function is 0 and no > further error is shown. This is a problem because the warning > message doesn't tell us which subprocess cmd f

Re: [PATCH v3 1/2 / RFC] builtin/branch: stop supporting the use of --set-upstream option

2017-08-15 Thread Junio C Hamano
Kaartic Sivaraam writes: > 1. Duplicate the check done in 'builtin/branch.c' in > 'builtin/checkout.c'. This doesn't > sound good to me. Doesn't sound good to me, either. Some refactoring to make it easier to reuse it from the new caller would be necessary.

Re: tsan: t3008: hashmap_add touches size from multiple threads

2017-08-15 Thread Stefan Beller
>>> /* total number of entries (0 means the hashmap is empty) */ >>> - unsigned int size; >>> + /* -1 means size is unknown for threading reasons */ >>> + int size; >> >> This double-encodes the state of disallow_rehash (i.e. if we had >> signed size, then the invariant di

git clean -fdx deletes tracked files

2017-08-15 Thread Kim Birkelund
Hi I hope this is gonna sound as weird to you as it does to me. The link below is a zip of a small git repository that I can reproduce the bug in on 2 machines. Repo: https://www.dropbox.com/s/fz4d0i5ko7s7ktr/test.zip?dl=0 It contains 2 folders: helpers and b, each of which is an empty npm modu

Re: tsan: t5400: set_try_to_free_routine

2017-08-15 Thread Martin Ågren
On 15 August 2017 at 19:35, Stefan Beller wrote: > On Tue, Aug 15, 2017 at 5:53 AM, Martin Ågren wrote: >> Using SANITIZE=thread made t5400-send-pack.sh hit the potential race >> below. >> >> This is set_try_to_free_routine in wrapper.c. The race relates to the >> reading of the "old" value. The

Re: [PATCH 4/5] strbuf_reset: don't write to slopbuf with ThreadSanitizer

2017-08-15 Thread Junio C Hamano
Martin Ågren writes: > If two threads have one freshly initialized string buffer each and call > strbuf_reset on them at roughly the same time, both threads will be > writing a '\0' to strbuf_slopbuf. That is not a problem in practice > since it doesn't matter in which order the writes happen. Bu

Re: tsan: t3008: hashmap_add touches size from multiple threads

2017-08-15 Thread Martin Ågren
On 15 August 2017 at 20:17, Stefan Beller wrote: > On Tue, Aug 15, 2017 at 10:59 AM, Jeff Hostetler > wrote: >> >> >> On 8/15/2017 8:53 AM, Martin Ågren wrote: >>> >>> Using SANITIZE=thread made t3008-ls-files-lazy-init-name-hash.sh hit >>> the potential race below. >>> >>> What seems to happen

Re: [PATCH 5/5] commit: rewrite read_graft_line

2017-08-15 Thread Junio C Hamano
Patryk Obara writes: > The previous implementation of read_graft_line used calculations based > on GIT_SHA1_RAWSZ and GIT_SHA1_HEXSZ to determine the number of commit > ids in a single graft line. New implementation does not depend on these > constants, so it adapts to any object_id buffer size.

Re: [PATCH 2/5] sha1_file: fix hardcoded size in null_sha1

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 11:23 AM, Junio C Hamano wrote: > Patryk Obara writes: > >> This prevents compilation error if GIT_MAX_RAWSZ is different than 20. >> >> Signed-off-by: Patryk Obara >> --- >> sha1_file.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > I think this is OK for

Re: [PATCH 4/5] commit: implement free_commit_graft

2017-08-15 Thread Junio C Hamano
Patryk Obara writes: > Signed-off-by: Patryk Obara > --- > commit.c | 11 --- > commit.h | 1 + > 2 files changed, 9 insertions(+), 3 deletions(-) I do not see a need to make this new function extern. Shouldn't it be made "static" and revert the change to commit.h? > diff --git a/co

Re: [PATCH 3/5] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-15 Thread Junio C Hamano
Patryk Obara writes: > This simplifies function declaration and allows for use of strbuf_rtrim > instead of modifying buffer directly. > > Signed-off-by: Patryk Obara > --- > builtin/blame.c | 2 +- > commit.c| 11 ++- > commit.h| 2 +- > 3 files changed, 8 insertions(

Re: [PATCH 2/5] sha1_file: fix hardcoded size in null_sha1

2017-08-15 Thread Junio C Hamano
Patryk Obara writes: > This prevents compilation error if GIT_MAX_RAWSZ is different than 20. > > Signed-off-by: Patryk Obara > --- > sha1_file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) I think this is OK for "null" thing, but in general I feel ambivalent when I see the use of

Re: [RFC 0/3] imap-send curl tunnelling support

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 10:49 AM, Nicolas Morey-Chaisemartin wrote: > Ping. > > I'd like to get feedback from Windows developer on patch #2 > Patch#3 will probably need some updates as I expected Jeff old curl drop > patches to make it in. > As it seems to be going another way a few more ifdefs w

Re: [PATCH] sub-process: print the cmd when a capability is unsupported

2017-08-15 Thread Jonathan Tan
On Tue, 15 Aug 2017 19:36:11 +0200 Christian Couder wrote: > In handshake_capabilities() we use warning() when a capability > is not supported, so the exit code of the function is 0 and no > further error is shown. This is a problem because the warning > message doesn't tell us which subprocess c

Re: tsan: t3008: hashmap_add touches size from multiple threads

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 10:59 AM, Jeff Hostetler wrote: > > > On 8/15/2017 8:53 AM, Martin Ågren wrote: >> >> Using SANITIZE=thread made t3008-ls-files-lazy-init-name-hash.sh hit >> the potential race below. >> >> What seems to happen is, threaded_lazy_init_name_hash ends up using >> hashmap_add o

Re: [PATCH v2] commit: skip discarding the index if there is no pre-commit hook

2017-08-15 Thread Junio C Hamano
Jeff King writes: > On Tue, Aug 15, 2017 at 04:23:50AM +, Kevin Willford wrote: > >> > This read_cache_from() should be a noop, right, because it immediately >> > sees istate->initialized is set? So it shouldn't matter that it is not >> > in the conditional with discard_cache(). Though if its

Re: tsan: t3008: hashmap_add touches size from multiple threads

2017-08-15 Thread Jeff Hostetler
On 8/15/2017 8:53 AM, Martin Ågren wrote: Using SANITIZE=thread made t3008-ls-files-lazy-init-name-hash.sh hit the potential race below. What seems to happen is, threaded_lazy_init_name_hash ends up using hashmap_add on the_index.dir_hash from two threads in a way that tsan considers racy. Whi

Re: Bug: `git remote show ` reports different HEAD branch than refs/remotes//HEAD

2017-08-15 Thread Jason Karns
On Tue, Aug 15, 2017 at 1:09 PM, Igor Djordjevic wrote: > Hi Jason, > > On 15/08/2017 16:26, Jason Karns wrote: >> I have a git repo that shows a different branch in >> `.git/refs/remotes/origin/HEAD` than is reported by `git remote show >> origin`. >> >> The branch is `github-rename` in refs/remo

Re: [RFC 0/3] imap-send curl tunnelling support

2017-08-15 Thread Nicolas Morey-Chaisemartin
Ping. I'd like to get feedback from Windows developer on patch #2 Patch#3 will probably need some updates as I expected Jeff old curl drop patches to make it in. As it seems to be going another way a few more ifdefs will be required Nicolas Le 09/08/2017 à 16:43, Nicolas Morey-Chaisemartin a éc

Re: [PATCH v2 1/2] clang-format: outline the git project's coding style

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 10:34 AM, Brandon Williams wrote: > On 08/15, Ben Peart wrote: >> >> >> On 8/14/2017 5:30 PM, Brandon Williams wrote: >> >Add a '.clang-format' file which outlines the git project's coding >> >style. This can be used with clang-format to auto-format .c and .h >> >files to

Re: [PATCH v2 1/2] clang-format: outline the git project's coding style

2017-08-15 Thread Brandon Williams
On 08/15, Ben Peart wrote: > > > On 8/14/2017 6:02 PM, Stefan Beller wrote: > >On Mon, Aug 14, 2017 at 2:30 PM, Brandon Williams wrote: > >>Add a '.clang-format' file which outlines the git project's coding > >>style. This can be used with clang-format to auto-format .c and .h > >>files to conf

[PATCH] sub-process: print the cmd when a capability is unsupported

2017-08-15 Thread Christian Couder
In handshake_capabilities() we use warning() when a capability is not supported, so the exit code of the function is 0 and no further error is shown. This is a problem because the warning message doesn't tell us which subprocess cmd failed. On the contrary if we cannot write a packet from this fun

Re: [PATCH v2 1/2] clang-format: outline the git project's coding style

2017-08-15 Thread Brandon Williams
On 08/15, Ben Peart wrote: > > > On 8/14/2017 5:30 PM, Brandon Williams wrote: > >Add a '.clang-format' file which outlines the git project's coding > >style. This can be used with clang-format to auto-format .c and .h > >files to conform with git's style. > > > >Signed-off-by: Brandon Williams

Re: tsan: t5400: set_try_to_free_routine

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 5:53 AM, Martin Ågren wrote: > Using SANITIZE=thread made t5400-send-pack.sh hit the potential race > below. > > This is set_try_to_free_routine in wrapper.c. The race relates to the > reading of the "old" value. The caller doesn't care about the "old" > value, so this shou

Re: [PATCH] hook: use correct logical variable

2017-08-15 Thread Junio C Hamano
Kaartic Sivaraam writes: > I guess Junio's suggestion found below seems concise enough > although it doesn't capture the reason I did the change. I did shoot for conciseness, but what is a lot more important is to record what is at the core of the issue. "I found it by doing A" can hint to care

Re: [PATCH 0/5] Modernize read_graft_line implementation

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 4:49 AM, Patryk Obara wrote: Welcome (back?) to the git mailing list! > I experimented with using a different hash algorithm (I am aware of > existing "Git hash function transition plan", I just want to push > things forward a bit) - and immediately hit a small issue - ch

Re: [RFC PATCH 0/7] Implement ref namespaces as a ref storage backend

2017-08-15 Thread Junio C Hamano
Richard Maw writes: > This is not my first attempt to improve the git namespace handling in git. > I tried last year, but it took me so long that all the ref handling code > changed > and I would have had to start from scratch. > > Fortunately the pluggable ref backends work provided an easier s

Re: [PATCH 5/5] commit: rewrite read_graft_line

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 4:49 AM, Patryk Obara wrote: > The previous implementation of read_graft_line used calculations based > on GIT_SHA1_RAWSZ and GIT_SHA1_HEXSZ to determine the number of commit > ids in a single graft line. New implementation does not depend on these > constants, so it adapt

Re: Bug: `git remote show ` reports different HEAD branch than refs/remotes//HEAD

2017-08-15 Thread Igor Djordjevic
Hi Jason, On 15/08/2017 16:26, Jason Karns wrote: > I have a git repo that shows a different branch in > `.git/refs/remotes/origin/HEAD` than is reported by `git remote show > origin`. > > The branch is `github-rename` in refs/remotes/origin/HEAD, but shows > `master` in output of git-remote-show

Re: [RFC PATCH 0/3] Fixes to "diff --color-moved" MIN_BLOCK_LENGTH handling

2017-08-15 Thread Junio C Hamano
Stefan Beller writes: >> I see what I wrote can be misread, especially due to its lack of >> ",instead", that I want to keep the broken one as-is, with neither >> reroll nor fixup. That is not what I meant. >> >> - If you choose to squash so that the resulting history after the >>series gra

Re: [PATCH 4/5] commit: implement free_commit_graft

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 4:49 AM, Patryk Obara wrote: Here is a good place to explain why this is a good patch, (which is not immediately obvious to me at least). > Signed-off-by: Patryk Obara > --- > commit.c | 11 --- > commit.h | 1 + > 2 files changed, 9 insertions(+), 3 deletions(

Re: [PATCH 3/5] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 4:49 AM, Patryk Obara wrote: > This simplifies function declaration and allows for use of strbuf_rtrim > instead of modifying buffer directly. > > Signed-off-by: Patryk Obara > --- > builtin/blame.c | 2 +- > commit.c| 11 ++- > commit.h| 2 +- >

Inconsistent exit code for `git grep --files-without-match` with `--quiet`

2017-08-15 Thread Anthony Sottile
Using the latest revision of git: $ ./git --version git version 2.14.GIT $ ./git-grep --files-without-match nope -- blob.c; echo $? blob.c 0 $ ./git-grep --files-without-match --quiet nope -- blob.c; echo $? 1 I expect both to exit 0 Note that blob.c does not contain "nope", here is the revisi

Re: [PATCH] t1002: stop using sum(1)

2017-08-15 Thread René Scharfe
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 original state. A later patch could convert t

Re: [PATCH 1/5] convert: initialize attr_action in convert_attrs

2017-08-15 Thread Martin Ågren
On 15 August 2017 at 16:17, Torsten Bögershausen wrote: > On Tue, Aug 15, 2017 at 02:53:01PM +0200, Martin Ågren wrote: >> convert_attrs populates a struct conv_attrs. The field attr_action is >> not set in all code paths, but still one caller unconditionally reads >> it. Since git_check_attr alwa

Re: [PATCH] t1002: stop using sum(1)

2017-08-15 Thread René Scharfe
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 > of POSIX.1-2008 [3]. OpenBS

Re: [PATCH 1/5] convert: initialize attr_action in convert_attrs

2017-08-15 Thread Torsten Bögershausen
> > diff --git a/convert.c b/convert.c > > index 1012462e3..943d957b4 100644 > > --- a/convert.c > > +++ b/convert.c > > @@ -1040,7 +1040,6 @@ static void convert_attrs(struct conv_attrs *ca, > > const char *path) > > ca->crlf_action = git_path_check_crlf(ccheck + 4); > >

Re: [PATCH v2 1/2] clang-format: outline the git project's coding style

2017-08-15 Thread Ben Peart
On 8/14/2017 5:30 PM, Brandon Williams wrote: Add a '.clang-format' file which outlines the git project's coding style. This can be used with clang-format to auto-format .c and .h files to conform with git's style. Signed-off-by: Brandon Williams --- .clang-format | 165 +++

Bug: `git remote show ` reports different HEAD branch than refs/remotes//HEAD

2017-08-15 Thread Jason Karns
I have a git repo that shows a different branch in `.git/refs/remotes/origin/HEAD` than is reported by `git remote show origin`. The branch is `github-rename` in refs/remotes/origin/HEAD, but shows `master` in output of git-remote-show ``` $ cat .git/refs/remotes/origin/HEAD ref: refs/remotes/ori

Re: [PATCH 1/5] convert: initialize attr_action in convert_attrs

2017-08-15 Thread Torsten Bögershausen
On Tue, Aug 15, 2017 at 02:53:01PM +0200, Martin Ågren wrote: > convert_attrs populates a struct conv_attrs. The field attr_action is > not set in all code paths, but still one caller unconditionally reads > it. Since git_check_attr always returns the same value, we'll always end > up in the same c

Re: [PATCH v2 1/2] clang-format: outline the git project's coding style

2017-08-15 Thread Ben Peart
On 8/14/2017 6:02 PM, Stefan Beller wrote: On Mon, Aug 14, 2017 at 2:30 PM, Brandon Williams wrote: Add a '.clang-format' file which outlines the git project's coding style. This can be used with clang-format to auto-format .c and .h files to conform with git's style. Signed-off-by: Brandon

[PATCH 3/5] Makefile: define GIT_THREAD_SANITIZER

2017-08-15 Thread Martin Ågren
When using ThreadSanitizer (tsan), it can be useful to avoid triggering false or irrelevant alarms. This should obviously be done with care and not to paper over real problems. Detecting that tsan is in use in a cross-compiler way is non-trivial. Tie into our existing SANITIZE=...-framework and de

[PATCH 4/5] strbuf_reset: don't write to slopbuf with ThreadSanitizer

2017-08-15 Thread Martin Ågren
If two threads have one freshly initialized string buffer each and call strbuf_reset on them at roughly the same time, both threads will be writing a '\0' to strbuf_slopbuf. That is not a problem in practice since it doesn't matter in which order the writes happen. But ThreadSanitizer will consider

[PATCH/RFC 0/5] Some ThreadSanitizer-results

2017-08-15 Thread Martin Ågren
I tried running the test suite on Git compiled with ThreadSanitizer (SANITIZE=thread). Maybe this series could be useful for someone else trying to do the same. I needed the first patch to avoid warnings when compiling, although it actually has nothing to do with threads. The last four patches are

[PATCH 1/5] convert: initialize attr_action in convert_attrs

2017-08-15 Thread Martin Ågren
convert_attrs populates a struct conv_attrs. The field attr_action is not set in all code paths, but still one caller unconditionally reads it. Since git_check_attr always returns the same value, we'll always end up in the same code path and there is no problem right now. But convert_attrs is obvio

tsan: t5400: set_try_to_free_routine

2017-08-15 Thread Martin Ågren
Using SANITIZE=thread made t5400-send-pack.sh hit the potential race below. This is set_try_to_free_routine in wrapper.c. The race relates to the reading of the "old" value. The caller doesn't care about the "old" value, so this should be harmless right now. But it seems that using this mechanism

tsan: t3008: hashmap_add touches size from multiple threads

2017-08-15 Thread Martin Ågren
Using SANITIZE=thread made t3008-ls-files-lazy-init-name-hash.sh hit the potential race below. What seems to happen is, threaded_lazy_init_name_hash ends up using hashmap_add on the_index.dir_hash from two threads in a way that tsan considers racy. While the buckets each have their own mutex, the

[PATCH 5/5] ThreadSanitizer: add suppressions

2017-08-15 Thread Martin Ågren
Add .tsan-suppressions for want_color() and transfer_debug(). Both of these use the pattern static int foo = -1; if (foo == -1) foo = func(); where func always returns the same value. This can cause ThreadSanitizer to diagnose a race when foo is written from two th

  1   2   >