[GSoC] Update: Week 1

2017-05-22 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

[PATCH v2 1/2] mingw.h: permit arguments with side effects for is_dir_sep

2017-05-22 Thread Johannes Sixt
Taking git-compat-util.h's cue (which uses an inline function to back is_dir_sep()), let's use an inline function to back also the Windows version of is_dir_sep(). This avoids problems when calling the function with arguments that do more than just provide a single character, e.g. incrementing a

[PATCHv2 0/6] Add option to recurse into submodules

2017-05-22 Thread Stefan Beller
v2: * this applies on sb/reset-recurse-submodules * grep and push are also respecting submodule.recurse now. * Brandon seemed to disagree with the first patch as it may hurt with his 'RFC repo object' series [1], but I explained a possible way out in [2] and Brandon seemed to agree that this

[PATCHv2 6/6] builtin/push.c: respect 'submodule.recurse' option

2017-05-22 Thread Stefan Beller
The closest mapping from the boolean 'submodule.recurse' set to "yes" to the variety of submodule push modes is "on-demand", so implement that. Signed-off-by: Stefan Beller --- builtin/push.c | 4 t/t5531-deep-submodule-push.sh | 21

[PATCHv2 2/6] submodule test invocation: only pass additional arguments

2017-05-22 Thread Stefan Beller
Signed-off-by: Stefan Beller --- t/lib-submodule-update.sh | 6 -- t/t1013-read-tree-submodule.sh | 4 ++-- t/t2013-checkout-submodule.sh | 4 ++-- t/t7112-reset-submodule.sh | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git

Re: [PATCH v3] ref-filter: trim end whitespace in subject

2017-05-22 Thread Johannes Sixt
Am 22.05.2017 um 19:10 schrieb DOAN Tran Cong Danh: diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh index 5778c0afe..fa4441868 100755 --- a/t/t3203-branch-output.sh +++ b/t/t3203-branch-output.sh @@ -13,7 +13,8 @@ test_expect_success 'make commits' ' test_expect_success

[PATCHv2 5/6] builtin/grep.c: respect 'submodule.recurse' option

2017-05-22 Thread Stefan Beller
In builtin/grep.c we parse the config before evaluating the command line options. This makes the task of teaching grep to respect the new config option 'submodule.recurse' very easy by just parsing that option. As an alternative I had implemented a similar structure to treat submodules as the

[PATCHv2 3/6] Introduce submodule.recurse option for worktree manipulators

2017-05-22 Thread Stefan Beller
Any command that understands '--recurse-submodules' can have its default changed to true, by setting the submodule.recurse option. This patch includes read-tree/checkout/reset for working tree manipulating commands. Later patches will cover other commands. Signed-off-by: Stefan Beller

Re: [PATCH v3] ref-filter: trim end whitespace in subject

2017-05-22 Thread Jeff King
On Mon, May 22, 2017 at 09:47:59PM +0200, Johannes Sixt wrote: > Am 22.05.2017 um 19:10 schrieb DOAN Tran Cong Danh: > > diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh > > index 5778c0afe..fa4441868 100755 > > --- a/t/t3203-branch-output.sh > > +++ b/t/t3203-branch-output.sh > >

Re: [PATCH v4 4/4] convert: add "status=delayed" to filter process protocol

2017-05-22 Thread Torsten Bögershausen
On 2017-05-22 15:50, Lars Schneider wrote: > +After Git received the pathnames, it will request the corresponding > +blobs again. These requests contain a pathname and an empty content > +section. The filter is expected to respond with the smudged content > +in the usual way as explained above. >

[PATCH v3] ref-filter: trim end whitespace in subject

2017-05-22 Thread DOAN Tran Cong Danh
From: ĐOÀN Trần Công Danh Commit 949af0684 ("branch: use ref-filter printing APIs", 2017-01-10) make `git branch -v` stops trimming end-whitespace in subject, and it stops treating next all-whitespace-line as an empty line. Quote from git mailing-list: > Here is a recipe

[PATCH] Documentation: Fix reference to isExists for interpret-trailers

2017-05-22 Thread Andreas Heiduk
The manual for "git interpret-trailers" mentioned a non-existing literal `overwrite` for its config option `trailer.ifexists`. Fixed by using `replace` instead. Signed-off-by: Andreas Heiduk --- Documentation/git-interpret-trailers.txt | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH v2 5/6] fsmonitor: add documentation for the fsmonitor extension.

2017-05-22 Thread Ævar Arnfjörð Bjarmason
On Mon, May 22, 2017 at 6:18 PM, Ben Peart wrote: > On 5/20/2017 8:10 AM, Ævar Arnfjörð Bjarmason wrote: >>> >>> +== File System Monitor cache >>> + >>> + The file system monitor cache tracks files for which the >>> query-fsmonitor >>> + hook has told us about changes. The

Re: What's cooking in git.git (May 2017, #06; Mon, 22)

2017-05-22 Thread Jonathan Nieder
Hi, Junio C Hamano wrote: > * bw/forking-and-threading (2017-05-15) 14 commits > - usage.c: drop set_error_handle() > - run-command: restrict PATH search to executable files > - run-command: expose is_executable function > - run-command: block signals between fork and execve > -

Re: Another git repo at kernel.org?

2017-05-22 Thread Ævar Arnfjörð Bjarmason
On Mon, May 22, 2017 at 8:34 PM, Stefan Beller wrote: > The Git community considers using submodules for some parts of the > code (a third party lib, SHA1DC, computing SHA1s that warn about > potential attachs, see shattered.io) [1]. > > We are also concerned about single

[PATCH] t5531: fix test description

2017-05-22 Thread Stefan Beller
The description of the test was not enclosed in single quotes, which broke the coloring scheme that I am used to. Upon closer inspection the test is good, but the description is a bit vague. So extend the description of the first test. While at it align the description of the file to match what

[PATCH v2 2/2] Windows: do not treat a path with backslashes as a remote's nick name

2017-05-22 Thread Johannes Sixt
Fetching from a remote using a native Windows path produces these warnings: C:\Temp\gittest>git fetch C:\Temp\gittest warning: unable to access '.git/remotes/C:\Temp\gittest': Invalid argument warning: unable to access '.git/branches/C:\Temp\gittest': Invalid argument >From C:\Temp\gittest *

Re: [PATCH v4 4/4] convert: add "status=delayed" to filter process protocol

2017-05-22 Thread Taylor Blau
I have no remaining concerns about the protocol specification in terms of implementing a filter with this capability.

Re: [WIP/RFC 00/23] repository object

2017-05-22 Thread Jeff King
On Thu, May 18, 2017 at 04:21:11PM -0700, Brandon Williams wrote: > When I first started working on the git project I found it very difficult to > understand parts of the code base because of the inherently global nature of > our code. It also made working on submodules very difficult. Since we

Re: [PATCH v3] ref-filter: trim end whitespace in subject

2017-05-22 Thread Johannes Sixt
Am 22.05.2017 um 21:53 schrieb Jeff King: On Mon, May 22, 2017 at 09:47:59PM +0200, Johannes Sixt wrote: Am 22.05.2017 um 19:10 schrieb DOAN Tran Cong Danh: diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh index 5778c0afe..fa4441868 100755 --- a/t/t3203-branch-output.sh +++

Re: [PATCH v4 4/4] convert: add "status=delayed" to filter process protocol

2017-05-22 Thread Lars Schneider
> On 22 May 2017, at 21:58, Torsten Bögershausen wrote: > > On 2017-05-22 15:50, Lars Schneider wrote: >> + >> +int async_query_available_blobs(const char *cmd, struct string_list >> *delayed_paths) >> +{ >> +int err; >> +char *line; >> +struct cmd2process *entry; >>

Another git repo at kernel.org?

2017-05-22 Thread Stefan Beller
Hi, The Git community considers using submodules for some parts of the code (a third party lib, SHA1DC, computing SHA1s that warn about potential attachs, see shattered.io) [1]. We are also concerned about single point of failure there, so a repo at kernel.org mirroring the potential

BUG: The .gitignore rules can't be made to cross submodule boundaries

2017-05-22 Thread Ævar Arnfjörð Bjarmason
When I was adding the sha1collisiondetection submodule to git.git I noticed that building git would dirty the submodule. This is because our own Makefile adds .depend/ directories. I hacked around it by just getting the upstream project accept carrying an ignore rule for that around:

Re: [PATCH v4 4/4] convert: add "status=delayed" to filter process protocol

2017-05-22 Thread Torsten Bögershausen
On 2017-05-22 15:50, Lars Schneider wrote: > + > +int async_query_available_blobs(const char *cmd, struct string_list > *delayed_paths) > +{ > + int err; > + char *line; > + struct cmd2process *entry; > + struct child_process *process; > + struct strbuf filter_status =

Re: [GSoC][PATCH v1 2/2] submodule: port submodule subcommand status

2017-05-22 Thread Stefan Beller
On Sun, May 21, 2017 at 5:27 AM, Prathamesh Chavan wrote: > This aims to make git-submodule status a builtin. 'status' is ported > to submodule--helper, and submodule--helper is called from > git-submodule.sh. > > For the purpose of porting cmd_status, the code is split up such

[PATCH] Documentation: Fix formatting typo in pretty-formats.txt

2017-05-22 Thread Andreas Heiduk
A missing space messed up formatting of the `%(trailers)` format. --- Documentation/pretty-formats.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt index 47b286b33..38040e95b 100644 ---

Re: [PATCH v4 4/4] convert: add "status=delayed" to filter process protocol

2017-05-22 Thread Lars Schneider
> On 22 May 2017, at 21:52, Torsten Bögershausen wrote: > > On 2017-05-22 15:50, Lars Schneider wrote: >> +After Git received the pathnames, it will request the corresponding >> +blobs again. These requests contain a pathname and an empty content >> +section. The filter is

Re: [PATCH v2 00/25] Prepare to separate out a packed_ref_store

2017-05-22 Thread Stefan Beller
On Mon, May 22, 2017 at 7:17 AM, Michael Haggerty wrote: > This is the second iteration of a patch series that prepares the > ground for separating out a `packed_ref_store` and then for changing > `packed-refs` to be read using `mmap()`. Thanks to Peff, Junio, > Stefan,

Re: [PATCH v2 0/2] Update sha1dc from upstream & optionally make it a submodule

2017-05-22 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > I liked the suggestion to make the URL a relative path, but this would > require you to maintain a mirror in the same places you push git.git > to, is that something you'd be willing to do? After thinking about this a bit more, I know what I

Re: [GSoC][PATCH v4 2/2] submodule: port subcommand foreach from shell to C

2017-05-22 Thread Stefan Beller
On Sun, May 21, 2017 at 5:58 AM, Prathamesh Chavan wrote: > I have also made some changes in git-submodule.sh for correcting > the $path variable. And hence made the corresponding changes in > the new test introduced in t7407-submodule-foreach as well. > I have push this work

[Bug] cloning a repository with a default MASTER branch tries to check out the master branch

2017-05-22 Thread Félix Saparelli
Hi, I created a git repository that, for joke reasons, has a single branch called MASTER (in uppercase). Upon cloning this repo, git attempts to checkout the master branch (in lowercase), which does not exist. Checking out the MASTER branch manually afterwards works. $ git clone

Re: [PATCH] ref-filter: treat CRLF as same as LF in find_subpos

2017-05-22 Thread Jeff King
On Mon, May 22, 2017 at 10:19:52AM +0900, Junio C Hamano wrote: > However. > > If you look at how `git branch -v` before that problematic change > removed the extra CR, you would notice that pretty_print_commit() > was used for that, which eventually called format_subject() with >

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-22 Thread Manish Goregaokar
What work is remaining for prune-in-worktree? Link to the relevant discussions? I might be able to take it over the finish line. (No guarantees) -Manish Goregaokar On Mon, May 22, 2017 at 4:17 AM, Duy Nguyen wrote: > On Sat, May 20, 2017 at 5:30 PM, Junio C Hamano

Re: [PATCHv3 04/20] diff.c: teach emit_line_0 to accept sign parameter

2017-05-22 Thread Stefan Beller
On Thu, May 18, 2017 at 4:33 PM, Jonathan Tan wrote: > I know I suggested the paragraph above, but after rereading your patch > set, I think I finally understand what you're trying to accomplish. > I think it's better to combine patches 4/20, 5/20, and 6/20, with the >

Passing revs to git-bundle-create via stdin

2017-05-22 Thread ch
Hi, I'm using git bundles to create (incremental) backups of my local repositories. This works quite well but for certain repositories I'm getting unexpectedly big incremental bundles. I did some testing and from what I can tell it seems git-bundle-create has issues processing revs passed via

Re: [PATCH] ref-filter: treat CRLF as same as LF in find_subpos

2017-05-22 Thread Junio C Hamano
Jeff King writes: > On Mon, May 22, 2017 at 10:19:52AM +0900, Junio C Hamano wrote: > >> However. >> >> If you look at how `git branch -v` before that problematic change >> removed the extra CR, you would notice that pretty_print_commit() >> was used for that, which eventually

[PATCHv4 16/17] diff: buffer all output if asked to

2017-05-22 Thread Stefan Beller
Introduce a new option 'use_buffer' in the struct diff_options which controls whether all output is buffered up until all output is available. We'll have a new struct 'diff_line' in diff.h which will be used to buffer each line. The diff_line will duplicate the memory of the line to buffer as

[PATCHv4 08/17] diff.c: convert emit_rewrite_lines to use emit_line_*

2017-05-22 Thread Stefan Beller
In a later patch, I want to propose an option to detect moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines (+ and -) that got moved. So to prepare the diff

[PATCHv4 06/17] diff.c: convert builtin_diff to use emit_line_*

2017-05-22 Thread Stefan Beller
In a later patch, I want to propose an option to detect moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines (+ and -) that got moved. So to prepare the diff

[PATCHv4 15/17] diff.c: emit_line includes whitespace highlighting

2017-05-22 Thread Stefan Beller
Currently any whitespace highlighting happens outside the emit_line function. Teach the highlighting to emit_line, triggered by a new parameter. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 107

[PATCHv4 12/17] diff.c: convert word diffing to use emit_line_*

2017-05-22 Thread Stefan Beller
In a later patch, I want to propose an option to detect moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines (+ and -) that got moved. So to prepare the diff

[PATCHv4 11/17] diff.c: convert show_stats to use emit_line_*

2017-05-22 Thread Stefan Beller
In a later patch, I want to propose an option to detect moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines (+ and -) that got moved. So to prepare the diff

[PATCHv4 09/17] submodule.c: convert show_submodule_summary to use emit_line_fmt

2017-05-22 Thread Stefan Beller
In a later patch, I want to propose an option to detect moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines (+ and -) that got moved. So to prepare the diff

[PATCHv4 07/17] diff.c: convert emit_rewrite_diff to use emit_line_*

2017-05-22 Thread Stefan Beller
In a later patch, I want to propose an option to detect moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines (+ and -) that got moved. So to prepare the diff

[PATCHv4 14/17] diff.c: convert diff_summary to use emit_line_*

2017-05-22 Thread Stefan Beller
In a later patch, I want to propose an option to detect moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines (+ and -) that got moved. So to prepare the diff

[PATCHv4 13/17] diff.c: convert diff_flush to use emit_line_*

2017-05-22 Thread Stefan Beller
In a later patch, I want to propose an option to detect moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines (+ and -) that got moved. So to prepare the diff

[PATCHv4 17/17] diff.c: color moved lines differently

2017-05-22 Thread Stefan Beller
When a patch consists mostly of moving blocks of code around, it can be quite tedious to ensure that the blocks are moved verbatim, and not undesirably modified in the move. To that end, color blocks that are moved within the same patch differently. For example (OM, del, add, and NM are different

[PATCHv4 10/17] diff.c: convert emit_binary_diff_body to use emit_line_*

2017-05-22 Thread Stefan Beller
In a later patch, I want to propose an option to detect moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines (+ and -) that got moved. So to prepare the diff

[PATCHv4 04/17] diff: introduce more flexible emit function

2017-05-22 Thread Stefan Beller
Currently, diff output is written either through the emit_line_0 function or through the FILE * in struct diff_options directly. To make it easier to teach diff to buffer its output (which will be done in a subsequent commit), introduce a more flexible emit_line() function. In this commit, direct

[PATCHv4 03/17] diff.c: factor out diff_flush_patch_all_file_pairs

2017-05-22 Thread Stefan Beller
In a later patch we want to do more things before and after all filepairs are flushed. So factor flushing out all file pairs into its own function that the new code can be plugged in easily. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano ---

[PATCHv4 05/17] diff.c: convert fn_out_consume to use emit_line

2017-05-22 Thread Stefan Beller
In a later patch, I want to propose an option to detect moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines (+ and -) that got moved. So to prepare the diff

Re: [PATCH] ref-filter: treat CRLF as same as LF in find_subpos

2017-05-22 Thread Junio C Hamano
Junio C Hamano writes: > Jeff King writes: > >> I suspect that's more work because we'd need to refactor pretty.c a bit >> to make the right functionality available. But the end result would be >> much more maintainable. > > I actually think the entire codeflow

Re: [PATCH v2 0/2] Update sha1dc from upstream & optionally make it a submodule

2017-05-22 Thread Junio C Hamano
Stefan Beller writes: > On Mon, May 22, 2017 at 3:27 PM, Junio C Hamano wrote: >> Ævar Arnfjörð Bjarmason writes: >> >>> I liked the suggestion to make the URL a relative path, but this would >>> require you to maintain a mirror in the

Re: [PATCH] usage: add NORETURN to BUG() function definitions

2017-05-22 Thread Junio C Hamano
Ramsay Jones writes: > Having said that, I rarely run sparse over just one file (except > when fixing a sparse error/warning). On each branch (master->next->pu) > I do > > $ make sparse >sp-out 2>&1 # nsp-out on 'next', psp-out on 'pu' > > ... so that I can diff

Re: [PATCH v3 1/6] Fix build with core.autocrlf=true

2017-05-22 Thread Junio C Hamano
Jonathan Nieder writes: > Junio, how do you prefer to handle this in git.git? Would you need to > amend the patch to remove the git-gui/.gitattributes change and wait > to get it from Pat, or is getting the same change twice okay? Yes, getting the same change twice should

[PATCHv4 00/17] Diff machine: highlight moved lines.

2017-05-22 Thread Stefan Beller
v4: * interdiff to v3 (what is currently origin/sb/diff-color-move) below. * renamed the "buffered_patch_line" to "diff_line". Originally I planned to not carry the "line" part as it can be a piece of a line as well. But for the intended functionality it is best to keep the name. If we'd

[PATCHv4 02/17] diff: move line ending check into emit_hunk_header

2017-05-22 Thread Stefan Beller
The emit_hunk_header() function is responsible for assembling a hunk header and calling emit_line() to send the hunk header to the output file. Its only caller fn_out_consume() needs to prepare for a case where the function emits an incomplete line and add the terminating LF. Instead make sure

[PATCHv4 01/17] diff: readability fix

2017-05-22 Thread Stefan Beller
We already have dereferenced 'p->two' into a local variable 'two'. Use that. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diff.c b/diff.c index

Re: [PATCH v4 6/6] clean: teach clean -d to skip dirs containing ignored files

2017-05-22 Thread Samuel Lijin
On Mon, May 22, 2017 at 2:17 AM, Junio C Hamano wrote: > Samuel Lijin writes: > >>> By the way, instead of putting NULL, it may be easier to follow if >>> you used two pointers, src and dst, into dir.entries[], just like >>> you did in your latest version of

Re: What's cooking in git.git (May 2017, #06; Mon, 22)

2017-05-22 Thread Junio C Hamano
Jonathan Nieder writes: > Junio C Hamano wrote: > >> * bw/forking-and-threading (2017-05-15) 14 commits >> - usage.c: drop set_error_handle() >> - run-command: restrict PATH search to executable files >> - run-command: expose is_executable function >> - run-command: block

Re: [Non-Bug] cloning a repository with a default MASTER branch tries to check out the master branch

2017-05-22 Thread Junio C Hamano
Félix Saparelli writes: > I created a git repository that, for joke reasons, has a single branch > called MASTER (in uppercase). Upon cloning this repo, git attempts to > checkout the master branch (in lowercase), which does not exist. See what Git told you carefully and you

Re: What's cooking in git.git (May 2017, #06; Mon, 22)

2017-05-22 Thread Jonathan Nieder
Junio C Hamano wrote: > Jonathan Nieder writes: >> Junio C Hamano wrote: >>> * bw/forking-and-threading (2017-05-15) 14 commits [...] >>> The "run-command" API implementation has been made more robust >>> against dead-locking in a threaded environment. >>> >>> Will merge

Re: [PATCH v2 0/2] Update sha1dc from upstream & optionally make it a submodule

2017-05-22 Thread Stefan Beller
On Mon, May 22, 2017 at 3:27 PM, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > >> I liked the suggestion to make the URL a relative path, but this would >> require you to maintain a mirror in the same places you push git.git >> to, is that

Re: [PATCH v4 4/4] convert: add "status=delayed" to filter process protocol

2017-05-22 Thread Junio C Hamano
Lars Schneider writes: >>> + sigchain_pop(SIGPIPE); >>> + >>> + if (err || errno == EPIPE) { >> >> This looks strange, at first glance. >> Do we set errno to 0 before ? >> Or is there a trick that EPIPE can only be reached, >> if it is "our" error ? > > You are

Re: What's cooking in git.git (May 2017, #06; Mon, 22)

2017-05-22 Thread Junio C Hamano
Jonathan Nieder writes: > Junio C Hamano wrote: >> Jonathan Nieder writes: >>> Junio C Hamano wrote: > * bw/forking-and-threading (2017-05-15) 14 commits > [...] The "run-command" API implementation has been made more robust against

Re: [PATCH] Documentation: Fix reference to isExists for interpret-trailers

2017-05-22 Thread Junio C Hamano
Thanks. I'll fix s/is/if/ on the title (no need to resend to fix only the subject).

Re: [PATCH] Documentation: Fix formatting typo in pretty-formats.txt

2017-05-22 Thread Junio C Hamano
Thanks.

Re: [PATCHv4 09/17] submodule.c: convert show_submodule_summary to use emit_line_fmt

2017-05-22 Thread Junio C Hamano
Stefan Beller writes: > diff --git a/submodule.c b/submodule.c > index d3299e29c0..428c996c97 100644 > --- a/submodule.c > +++ b/submodule.c > ... > @@ -547,15 +543,16 @@ void show_submodule_inline_diff(FILE *f, const char > *path, > if (right) > new =

Re: [PATCH v4 6/6] clean: teach clean -d to skip dirs containing ignored files

2017-05-22 Thread Junio C Hamano
Samuel Lijin writes: >> By the way, instead of putting NULL, it may be easier to follow if >> you used two pointers, src and dst, into dir.entries[], just like >> you did in your latest version of [PATCH 4/6]. That way, you do not >> have to change anything in the later loop

Re: [PATCH v2 2/2] sha1dc: optionally use sha1collisiondetection as a submodule

2017-05-22 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > I thought this should have something like this: > ... > the right thing, even though this is set unconditionally. There must > be some Makefile magic I'm missing here. The magic you are missing is that to ifdef in $(MAKE), a variable that is

What's cooking in git.git (May 2017, #06; Mon, 22)

2017-05-22 Thread Junio C Hamano
What's cooking in git.git (May 2017, #06; Mon, 22) -- Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear

Re: [PATCH v2 2/2] sha1dc: optionally use sha1collisiondetection as a submodule

2017-05-22 Thread Ævar Arnfjörð Bjarmason
On Mon, May 22, 2017 at 4:48 AM, Junio C Hamano wrote: > Junio C Hamano writes: > >> But when somebody (like me?) feels strongly enough, such a change >> can always come on top of this patch, so let's have this >> manual-configuration-only version as our

Re: [PATCH v4 6/6] clean: teach clean -d to skip dirs containing ignored files

2017-05-22 Thread Samuel Lijin
On Mon, May 22, 2017 at 12:48 AM, Junio C Hamano wrote: > Samuel Lijin writes: > >> + for (j = i = 0; i < dir.nr;) { >> + for (; >> + j < dir.ignored_nr && >> +0 <= cmp_dir_entry([i], [j]); >> +

Re: [PATCH 0/2] Fix warnings on access of a remote with Windows paths

2017-05-22 Thread Johannes Schindelin
Hi Hannes, On Sat, 20 May 2017, Johannes Sixt wrote: > This small series fixes these warnings on Windows: > > C:\Temp\gittest>git fetch C:\Temp\gittest > warning: unable to access '.git/remotes/C:\Temp\gittest': Invalid argument > warning: unable to access '.git/branches/C:\Temp\gittest':

Re: [PATCH 0/2] Fix warnings on access of a remote with Windows paths

2017-05-22 Thread stefan.naewe
Am 20.05.2017 um 08:28 schrieb Johannes Sixt: > This small series fixes these warnings on Windows: > > C:\Temp\gittest>git fetch C:\Temp\gittest > warning: unable to access '.git/remotes/C:\Temp\gittest': Invalid argument > warning: unable to access '.git/branches/C:\Temp\gittest': Invalid

Re: [PATCH v2] mingw: simplify PATH handling

2017-05-22 Thread Johannes Schindelin
Hi René, On Sat, 20 May 2017, René Scharfe wrote: > On Windows the environment variable PATH contains a semicolon-separated > list of directories to search for, in order, when looking for the > location of a binary to run. get_path_split() parses it and returns an > array of string copies,

Re: [PATCH 2/2] Windows: do not treat a path with backslashes as a remote's nick name

2017-05-22 Thread Johannes Schindelin
Hi Hannes, On Sat, 20 May 2017, Johannes Sixt wrote: > Fetching from a remote using a native Windows path produces these warnings: > > C:\Temp\gittest>git fetch C:\Temp\gittest > warning: unable to access '.git/remotes/C:\Temp\gittest': Invalid argument > warning: unable to access

Re: [PATCH 1/2] mingw.h: permit arguments with side effects for is_dir_sep

2017-05-22 Thread Johannes Schindelin
Hi Hannes, On Sat, 20 May 2017, Johannes Sixt wrote: > The implementation of is_dir_sep in git-compat-util.h uses an inline > function. Use one also for the implementation in compat/mingw.h to support > non-trivial argument expressions. > > Signed-off-by: Johannes Sixt I was a

Re: [WIP/RFC 00/23] repository object

2017-05-22 Thread Johannes Schindelin
Hi Stefan, On Sat, 20 May 2017, Stefan Beller wrote: > On Thu, May 18, 2017 at 4:21 PM, Brandon Williams wrote: > > > This is still very much in a WIP state, though it does pass all tests. What > > I'm hoping for here is to get a discussion started about the feasibility of

Re: [PATCH] usage: add NORETURN to BUG() function definitions

2017-05-22 Thread Jeff King
On Sun, May 21, 2017 at 11:25:39PM +0100, Ramsay Jones wrote: > Commit d8193743e0 ("usage.c: add BUG() function", 12-05-2017) added the > BUG() functions and macros as a replacement for calls to die("BUG: .."). > The use of NORETURN on the declarations (in git-compat-util.h) and the > lack of

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-22 Thread Duy Nguyen
On Sat, May 20, 2017 at 5:30 PM, Junio C Hamano wrote: > By the way, doesn't nd/prune-in-worktree topic that has been cooking > in 'pu' supersede this change? It not just protects the commit at > the tip of HEAD in each worktree, it also makes sure the ones in > HEAD's reflog

Re: [PATCH v5] send-email: --batch-size to work around some SMTP server limit

2017-05-22 Thread Ævar Arnfjörð Bjarmason
On Sun, May 21, 2017 at 2:59 PM, xiaoqiang zhao wrote: > Some email servers (e.g. smtp.163.com) limit the number emails to be > sent per session(connection) and this will lead to a faliure when > sending many messages. This OK to me, the nits I had are addressed by Junio's

Re: [PATCH] ref-filter: treat CRLF as same as LF in find_subpos

2017-05-22 Thread DOAN Tran Cong Danh
On 05/22/2017 09:19 AM, Junio C Hamano wrote: > If you look at how `git branch -v` before that problematic change > removed the extra CR, you would notice that pretty_print_commit() > was used for that, which eventually called format_subject() with > "one\r\n\r\nline3...", got one line "one\r\n"

Re: reversion in GIT_COMMON_DIR refs path

2017-05-22 Thread Duy Nguyen
On Fri, May 19, 2017 at 9:37 PM, Joey Hess wrote: > Joey Hess wrote: >> Bisecting this test suite failure >> https://git-annex.branchable.com/git-annex_in_nixpkgs_fails_with_git-2.13.0/ >> I landed on commit f57f37e2e1bf11ab4cdfd221ad47e961ba9353a0 to git. >> >> It seems that

Re: [PATCH 0/2] Fix warnings on access of a remote with Windows paths

2017-05-22 Thread Johannes Schindelin
Hi Stefan, On Mon, 22 May 2017, stefan.na...@atlas-elektronik.com wrote: > Am 20.05.2017 um 08:28 schrieb Johannes Sixt: > > This small series fixes these warnings on Windows: > > > > C:\Temp\gittest>git fetch C:\Temp\gittest > > warning: unable to access '.git/remotes/C:\Temp\gittest': Invalid

Re: [PATCH] usage: add NORETURN to BUG() function definitions

2017-05-22 Thread Ramsay Jones
On 22/05/17 03:46, Junio C Hamano wrote: > Hmph. I do not know what went wrong. The one I had in /usr/bin > that came from the distro was too old that it didn't give any useful > result and failed, and that was why I got v0.5.0-207-g14964df > installed in ~/gitstuff/bin/ which is early on my

[PATCH v2 01/25] t3600: clean up permissions test properly

2017-05-22 Thread Michael Haggerty
The test of failing `git rm -f` removes the write permissions on the test directory, but fails to restore them if the test fails. This means that the test temporary directory cannot be cleaned up, which means that subsequent attempts to run the test fail mysteriously. Instead, do the cleanup in a

[PATCH v2 12/25] files_transaction_cleanup(): new helper function

2017-05-22 Thread Michael Haggerty
Extract the cleanup functionality from `files_transaction_commit()` into a new function. It will soon have another caller. Use the common cleanup code even on early exit if the transaction is empty, to reduce code duplication. Signed-off-by: Michael Haggerty ---

[PATCH v2 00/25] Prepare to separate out a packed_ref_store

2017-05-22 Thread Michael Haggerty
This is the second iteration of a patch series that prepares the ground for separating out a `packed_ref_store` and then for changing `packed-refs` to be read using `mmap()`. Thanks to Peff, Junio, Stefan, Brandon, and Johannes for their feedback about v1 [1]. I think I have addressed all of your

[PATCH v2 11/25] files_ref_store: put the packed files lock directly in this struct

2017-05-22 Thread Michael Haggerty
Instead of using a global `lock_file` instance for the main "packed-refs" file and using a pointer in `files_ref_store` to keep track of whether it is locked, embed the `lock_file` instance directly in the `files_ref_store` struct and use the new `is_lock_file_locked()` function to keep track of

[PATCH v2 10/25] files-backend: move `lock` member to `files_ref_store`

2017-05-22 Thread Michael Haggerty
Move the `lock` member from `packed_ref_cache` to `files_ref_store`, since at most one cache can have a locked "packed-refs" file associated with it. Rename it to `packed_refs_lock` to make its purpose clearer in its new home. More changes are coming here shortly. Signed-off-by: Michael Haggerty

[PATCH v2 14/25] ref_transaction_prepare(): new optional step for reference updates

2017-05-22 Thread Michael Haggerty
In the future, compound reference stores will sometimes need to modify references in two different reference stores at the same time, meaning that a single logical reference transaction might have to be implemented as two internal sub-transactions. They won't want to call

[PATCH v2 08/25] ref_store: take a `msg` parameter when deleting references

2017-05-22 Thread Michael Haggerty
Just because the files backend can't retain reflogs for deleted references is no reason that they shouldn't be supported by the virtual method interface. Also, `delete_ref()` and `refs_delete_ref()` have already gained `msg` parameters. Now let's add them to `delete_refs()` and

mr neil

2017-05-22 Thread neil trotter
A Donation Of 1 Million Pounds To You In Good Faith

[PATCH v2 16/25] ref_update_reject_duplicates(): use `size_t` rather than `int`

2017-05-22 Thread Michael Haggerty
Eliminate a theoretical risk of integer overflow if the two types have different sizes. Signed-off-by: Michael Haggerty --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs.c b/refs.c index beb49fb297..143936a9c3 100644 --- a/refs.c +++

[PATCH v2 07/25] refs: use `size_t` indexes when iterating over ref transaction updates

2017-05-22 Thread Michael Haggerty
Eliminate any chance of integer overflow on platforms where the two types have different sizes. Signed-off-by: Michael Haggerty --- refs.c | 2 +- refs/files-backend.c | 6 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/refs.c b/refs.c

[PATCH v2 06/25] refs_ref_iterator_begin(): don't check prefixes redundantly

2017-05-22 Thread Michael Haggerty
The backend already correctly restricts its output to references whose names start with the prefix. By passing the prefix again to `prefix_ref_iterator`, we were forcing that iterator to do redundant prefix comparisons. So set it to the empty string. Signed-off-by: Michael Haggerty

[PATCH v2 02/25] refs.h: clarify docstring for the ref_transaction_update()-related fns

2017-05-22 Thread Michael Haggerty
In particular, make it clear that they make copies of the sha1 arguments. Signed-off-by: Michael Haggerty --- refs.h | 13 + 1 file changed, 13 insertions(+) diff --git a/refs.h b/refs.h index 685a979a0e..ec8c6bfbbb 100644 --- a/refs.h +++ b/refs.h @@ -427,6

[PATCH v2 03/25] ref_iterator_begin_fn(): fix docstring

2017-05-22 Thread Michael Haggerty
The iterator returned by this function only includes references whose names start with the whole prefix, not all of those in `find_containing_dir(prefix)` as the old docstring claimed. This docstring was probably copy-pasted from old ref-cache code, which had the old specification. But now,

[PATCH v2 09/25] lockfile: add a new method, is_lock_file_locked()

2017-05-22 Thread Michael Haggerty
It will soon prove useful. Signed-off-by: Michael Haggerty --- lockfile.h | 8 1 file changed, 8 insertions(+) diff --git a/lockfile.h b/lockfile.h index 7b715f9e77..572064939c 100644 --- a/lockfile.h +++ b/lockfile.h @@ -175,6 +175,14 @@ static inline int

  1   2   >