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] 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: [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: 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: [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: [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

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: [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 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] 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 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

[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 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 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 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 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 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

[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 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 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 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 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 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

[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

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

2017-05-22 Thread Junio C Hamano
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 of "find positions and length of threeparts" using

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

Re: [PATCH] usage: fix a sparse 'redeclared with different type' error

2017-05-22 Thread Luc Van Oostenryck
On Tue, May 16, 2017 at 5:02 AM, Jeff King wrote: > On Tue, May 16, 2017 at 02:11:40AM +0100, Ramsay Jones wrote: > >> >> If you need to re-roll your 'jk/bug-to-abort' branch, could you please >> squash this into the relevant patch (commit d8193743e0 "usage.c: add >> BUG()

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: [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 >

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: [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 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

[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 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: [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: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; >>

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 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] 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: [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

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: [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. >

[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

[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: 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

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 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.

[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 *

[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

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 v3 1/6] Fix build with core.autocrlf=true

2017-05-22 Thread Jonathan Nieder
(+cc: Pat Thoyts, git-gui maintainer) Hi, Johannes Schindelin wrote: > On Windows, the default line endings are denoted by a Carriage Return > byte followed by a Line Feed byte, while Linux and MacOSX use a single > Line Feed byte to denote a line ending. > > To help with this situation, Git

[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

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: [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

[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

Re: [PATCH] diff: mark some file local symbols as static

2017-05-22 Thread Stefan Beller
On Sat, May 20, 2017 at 4:37 PM, Ramsay Jones wrote: > > Signed-off-by: Ramsay Jones > --- > > Hi Stefan, > > If you need to re-roll your 'sb/diff-color-move' branch, could you > please squash this into to the relevant patches. (Each hunk

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

2017-05-22 Thread Johannes Sixt
Am 22.05.2017 um 13:59 schrieb Johannes Schindelin: 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

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

2017-05-22 Thread Johannes Sixt
Am 22.05.2017 um 16:01 schrieb Johannes Schindelin: 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

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

2017-05-22 Thread Ben Peart
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 signature for this extension is + { 'F', 'S', 'M', 'N' }. + + The extension starts with + +

Re: Git 2.13 silent install

2017-05-22 Thread Johannes Schindelin
Hi Konst, On Mon, 22 May 2017, Konstantin Khomoutov wrote: > On Fri, May 12, 2017 at 09:55:04AM -0400, Rabii Elguermouni wrote: > > > Just wondering if someone can send me the instructions for an > > unattended/silent install for Git 2.13. > > This guide [1] is outdated but should be

[PATCH v2] 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 v2 13/25] ref_transaction_commit(): check for valid `transaction->state`

2017-05-22 Thread Michael Haggerty
Move the check that `transaction->state` is valid from `files_transaction_commit()` to `ref_transaction_commit()`, where other future reference backends can benefit from it as well. Signed-off-by: Michael Haggerty --- refs.c | 12

[PATCH v2 18/25] should_pack_ref(): new function, extracted from `files_pack_refs()`

2017-05-22 Thread Michael Haggerty
Extract a function for deciding whether a reference should be packed. It is a self-contained bit of logic, so splitting it out improves readability. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 42 -- 1 file changed, 28

[PATCH v2 24/25] ref-filter: limit traversal to prefix

2017-05-22 Thread Michael Haggerty
From: Jeff King When we are matching refnames against a pattern, then we know that the beginning of any refname that can match the pattern has to match the part of the pattern up to the first glob character. For example, if the pattern is `refs/heads/foo*bar`, then it can only

[PATCH v2 21/25] read_packed_refs(): report unexpected fopen() failures

2017-05-22 Thread Michael Haggerty
The old code ignored any errors encountered when trying to fopen the "packed-refs" file, treating all such failures as if the file didn't exist. But it could be that there is some other error opening the file (e.g., permissions problems), and we don't want to silently ignore such problems. So

[PATCH v2 23/25] create_ref_entry(): remove `check_name` option

2017-05-22 Thread Michael Haggerty
Only one caller was using it, so move the check to that caller. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 12 refs/ref-cache.c | 6 +- refs/ref-cache.h | 3 +-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git

[PATCH v2 25/25] cache_ref_iterator_begin(): avoid priming unneeded directories

2017-05-22 Thread Michael Haggerty
When iterating over references, reference priming is used to make sure that loose references are read into the ref-cache before packed references, to avoid races. It used to be that the prefix passed to reference iterators almost always ended in `/`, for example `refs/heads/`. In that case, the

[PATCH v2 19/25] get_packed_ref_cache(): assume "packed-refs" won't change while locked

2017-05-22 Thread Michael Haggerty
If we've got the "packed-refs" file locked, then it can't change; there's no need to keep calling `stat_validity_check()` on it. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git

[PATCH v2 15/25] ref_update_reject_duplicates(): expose function to whole refs module

2017-05-22 Thread Michael Haggerty
It will soon have some other users. Signed-off-by: Michael Haggerty --- refs.c | 17 + refs/files-backend.c | 17 - refs/refs-internal.h | 8 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/refs.c

[PATCH v2 22/25] refs_ref_iterator_begin(): handle `GIT_REF_PARANOIA`

2017-05-22 Thread Michael Haggerty
Instead of handling `GIT_REF_PARANOIA` in `files_ref_iterator_begin()`, handle it in `refs_ref_iterator_begin()`, where it will cover all reference stores. Signed-off-by: Michael Haggerty --- refs.c | 5 + refs/files-backend.c | 11 --- 2 files

[PATCH v2 17/25] ref_update_reject_duplicates(): add a sanity check

2017-05-22 Thread Michael Haggerty
It's pretty cheap to make sure that the caller didn't pass us an unsorted list by accident, so do so. Signed-off-by: Michael Haggerty --- refs.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index 143936a9c3..d1c781d94e

[PATCH v2 20/25] read_packed_refs(): do more of the work of reading packed refs

2017-05-22 Thread Michael Haggerty
Teach `read_packed_refs()` to also * Allocate and initialize the new `packed_ref_cache` * Open and close the `packed-refs` file * Update the `validity` field of the new object This decreases the coupling between `packed_refs_cache` and `files_ref_store` by a little bit. Signed-off-by: Michael

[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 05/25] prefix_ref_iterator: don't trim too much

2017-05-22 Thread Michael Haggerty
The `trim` parameter can be set independently of `prefix`. So if some caller were to set `trim` to be greater than `strlen(prefix)`, we could end up pointing the `refname` field of the iterator past the NUL of the actual reference name string. That can't happen currently, because `trim` is always

[PATCH v2 04/25] files-backend: use `die("BUG: ...")`, not `die("internal error: ...")`

2017-05-22 Thread Michael Haggerty
The former is by far more common in our codebase. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index cb1f528cbe..fa5d2b6f08 100644 ---

[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 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

[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 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 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

  1   2   >