Re: Possible minor bug in Git

2019-02-01 Thread Torsten Bögershausen
On Fri, Feb 01, 2019 at 10:02:50AM +0200, Angelo Melonas wrote: > Hi Torsten, > > Thank you so much for getting back to me. > > Unfortunately, I believe there is a misunderstanding, as I may have > explained what I found to be a possible bug incorrectly. > The file that is originally added (and the

Re: [PATCH v2 [rebased]] [Enhancement] Improve internals / refactoring.

2019-02-01 Thread Brandon Richardson
Hi Shahzad, On Fri, 1 Feb 2019 at 19:54, Shahzad Lone wrote: > git_zstream stream; > - unsigned char ibuf[1024 * 16]; > - unsigned char obuf[1024 * 16]; > + unsigned char ibuf[16384]; > + unsigned char obuf[16384]; > unsigned long olen = 0; This change als

Re: [PATCH 7/9] submodule: migrate get_next_submodule to use repository structs

2019-02-01 Thread Jonathan Nieder
Hi, Stefan Beller wrote: > This patch tightens the check upfront, such that we do not need > to spawn a child process to find out if the submodule is broken. Sounds sensible. [...] > --- a/submodule.c > +++ b/submodule.c [...] > @@ -1319,10 +1338,23 @@ static int get_next_submodule(struct child

[RFC] Sample of test for git branch -vv

2019-02-01 Thread nbelakovski
From: Nickolai Belakovski I remember now why I didn't add a test for this one earlier. Testing git branch -vv is a little tricky for a couple reasons. For one thing, the output contains commit hashes, so the 'expect' file cannot be simply static. For another, the output doesn't have clear del

Re: [PATCH 0/1] Using sparse in a CI job

2019-02-01 Thread SZEDER Gábor
On Fri, Feb 01, 2019 at 09:01:20PM +, Ramsay Jones wrote: > I suspect that the Makefile sparse target is not easy to use in a CI > job, since the 'sparse' program (via cgcc -no-compile) does not exit > with a non-zero value, even when issuing errors and warnings. We had the same issue with Coc

[PATCH v2 [rebased]] [Enhancement] Improve internals / refactoring.

2019-02-01 Thread Shahzad Lone
Changed to ```consts``` and tried to save arithmetic cost where I could. Sorry my coding OCD bothered me when I didn't see them being ```consts```. Signed-off-by: Shahzad Lone --- builtin/diff.c | 2 +- builtin/pack-objects.c | 18 +- builtin/pack-redundant.c | 4 +

Re: [PATCH v7 0/3]

2019-02-01 Thread Nickolai Belakovski
On Fri, Feb 1, 2019 at 2:54 PM Junio C Hamano wrote: > > > As you can see in "git shortlog --no-merges", later two patches > would look quite out of place by having overlong title and starting > the description(i.e. after ": ") in a capital letter. Hadn't looked at it that way. OK, will shorten/u

Re: [PATCH v7 2/3] branch: Mark and color a branch differently if it is checked out in a linked worktree

2019-02-01 Thread Nickolai Belakovski
On Fri, Feb 1, 2019 at 2:54 PM Junio C Hamano wrote: > > > I had to apply and then use --color-words to see what is going on. > Please avoid unnecessary reflowing of the text that makes the patch > harder than necessary to read. I was trying to keep the line length consistent. How else can I acco

Re: [PATCH v7 3/3] branch: Add an extra verbose output displaying worktree path for refs checked out in a linked worktree

2019-02-01 Thread Nickolai Belakovski
On Fri, Feb 1, 2019 at 2:54 PM Junio C Hamano wrote: > > If the rule were "a branch that is checked out in one of the > worktrees connected to the repository is shown with the path to that > worktree" (i.e. no exception), I would understand it. If the rule > were "a branch that is ... (the same

Re: [PATCH v7 2/3] branch: Mark and color a branch differently if it is checked out in a linked worktree

2019-02-01 Thread Junio C Hamano
nbelakov...@gmail.com writes: > If `--list` is given, or if there are no non-option arguments, existing > -branches are listed; the current branch will be highlighted with an > -asterisk. Option `-r` causes the remote-tracking branches to be listed, > -and option `-a` shows both local and remote

Re: [PATCH v7 1/3] ref-filter: add worktreepath atom

2019-02-01 Thread Junio C Hamano
nbelakov...@gmail.com writes: > +static void lazy_init_worktree_map(void) > +{ > + if (ref_to_worktree_map.worktrees) > + return; > + > + ref_to_worktree_map.worktrees = get_worktrees(0); > + hashmap_init(&(ref_to_worktree_map.map), ref_to_worktree_map_cmpfnc, > NULL, 0);

Re: [PATCH v7 3/3] branch: Add an extra verbose output displaying worktree path for refs checked out in a linked worktree

2019-02-01 Thread Junio C Hamano
nbelakov...@gmail.com writes: > @@ -167,8 +167,10 @@ This option is only applicable in non-verbose mode. > When in list mode, > show sha1 and commit subject line for each head, along with > relationship to upstream branch (if any). If given twice, print > - the name of the up

Re: [PATCH v7 0/3]

2019-02-01 Thread Junio C Hamano
nbelakov...@gmail.com writes: > ref-filter: add worktreepath atom > branch: Mark and color a branch differently if it is checked out in a > linked worktree > branch: Add an extra verbose output displaying worktree path for refs > checked out in a linked worktree As you can see in "g

Re: [PATCH 1/1] Makefile: improve SPARSE_FLAGS customisation

2019-02-01 Thread Luc Van Oostenryck
On Fri, Feb 01, 2019 at 01:46:13PM -0800, Junio C Hamano wrote: > Ramsay Jones writes: > > > In order to enable greater user customisation of the SPARSE_FLAGS > > variable, we introduce a new SP_EXTRA_FLAGS variable to use for > > target specific settings. Without using the new variable, setting

Re: [PATCH v7 3/3] branch: Add an extra verbose output displaying worktree path for refs checked out in a linked worktree

2019-02-01 Thread Nickolai Belakovski
On Fri, Feb 1, 2019 at 2:28 PM Eric Sunshine wrote: > > On Fri, Feb 1, 2019 at 5:04 PM wrote: > > Subject: branch: Add an extra verbose output displaying worktree path for > > refs checked out in a linked worktree > > Overlong subject. Perhaps shorten it to: > > branch: display worktree path

Re: [PATCH v7 1/3] ref-filter: add worktreepath atom

2019-02-01 Thread Nickolai Belakovski
On Fri, Feb 1, 2019 at 2:20 PM Eric Sunshine wrote: > > On Fri, Feb 1, 2019 at 5:04 PM wrote: > > Add an atom providing the path of the linked worktree where this ref is > > checked out, if it is checked out in any linked worktrees, and empty > > string otherwise. > > > > Signed-off-by: Nickolai

Re: [PATCH 0/1] Using sparse in a CI job

2019-02-01 Thread Luc Van Oostenryck
On Fri, Feb 01, 2019 at 09:01:20PM +, Ramsay Jones wrote: > > I suspect that the Makefile sparse target is not easy to use in a CI > job, since the 'sparse' program (via cgcc -no-compile) does not exit > with a non-zero value, even when issuing errors and warnings. ... > We can change that

Re: [PATCH v7 3/3] branch: Add an extra verbose output displaying worktree path for refs checked out in a linked worktree

2019-02-01 Thread Eric Sunshine
On Fri, Feb 1, 2019 at 5:04 PM wrote: > Subject: branch: Add an extra verbose output displaying worktree path for > refs checked out in a linked worktree Overlong subject. Perhaps shorten it to: branch: display worktree path in -v -v mode or something, and use the longer description as the

Re: [PATCH v7 1/3] ref-filter: add worktreepath atom

2019-02-01 Thread Eric Sunshine
On Fri, Feb 1, 2019 at 5:04 PM wrote: > Add an atom providing the path of the linked worktree where this ref is > checked out, if it is checked out in any linked worktrees, and empty > string otherwise. > > Signed-off-by: Nickolai Belakovski > --- > diff --git a/Documentation/git-for-each-ref.txt

[PATCH v7 2/3] branch: Mark and color a branch differently if it is checked out in a linked worktree

2019-02-01 Thread nbelakovski
From: Nickolai Belakovski The output of git branch is modified to mark branches checkout out in a linked worktree with a "+" and color them in cyan (in contrast to the current branch, which will still be denoted with a "*" and colored in green) This is meant to communicate to the user that the b

[PATCH v7 3/3] branch: Add an extra verbose output displaying worktree path for refs checked out in a linked worktree

2019-02-01 Thread nbelakovski
From: Nickolai Belakovski Signed-off-by: Nickolai Belakovski --- Documentation/git-branch.txt | 6 -- builtin/branch.c | 4 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index b3eca6ffdc..778be7080

[PATCH v7 1/3] ref-filter: add worktreepath atom

2019-02-01 Thread nbelakovski
From: Nickolai Belakovski Add an atom providing the path of the linked worktree where this ref is checked out, if it is checked out in any linked worktrees, and empty string otherwise. Signed-off-by: Nickolai Belakovski --- Documentation/git-for-each-ref.txt | 5 +++ ref-filter.c

[PATCH v7 0/3]

2019-02-01 Thread nbelakovski
From: Nickolai Belakovski Moved initialization of ref_to_worktree_map outside of atom parser. Other minor fixes. Put the hashmap and the worktree struct in the same struct, to make it more obvious that they are to be initialized and free'd together. Travis CI results: https://travis-ci.org/n

Re: [PATCH v9 1/6] t5323: test cases for git-pack-redundant

2019-02-01 Thread Eric Sunshine
On Fri, Feb 1, 2019 at 4:03 PM Junio C Hamano wrote: > Eric Sunshine writes: > > On Fri, Feb 1, 2019 at 11:22 AM Jiang Xin wrote: > >> +# Note: DO NOT run it in a subshell, otherwise the variables will not be > >> set > > > > Which variables won't be set? It's not clear what this restriction is

Re: [PATCH 1/1] Makefile: improve SPARSE_FLAGS customisation

2019-02-01 Thread Junio C Hamano
Ramsay Jones writes: > In order to enable greater user customisation of the SPARSE_FLAGS > variable, we introduce a new SP_EXTRA_FLAGS variable to use for > target specific settings. Without using the new variable, setting > the SPARSE_FLAGS on the 'make' command-line would also override the > va

Re: [PATCH] http: cast result to FILE *

2019-02-01 Thread Junio C Hamano
Dan McGregor writes: > Commit 8dd2e88a92 ("http: support file handles for HTTP_KEEP_ERROR", > 2019-01-10) introduced an implicit assumption that rewind, fileno, and > fflush are functions. At least on FreeBSD fileno is not, and as such > passing a void * failed. I am not strongly opposed to this

Re: [PATCH v9 1/6] t5323: test cases for git-pack-redundant

2019-02-01 Thread Junio C Hamano
Eric Sunshine writes: > On Fri, Feb 1, 2019 at 11:22 AM Jiang Xin wrote: >> Add test cases for git pack-redundant to validate new algorithm for git >> pack-redundant. >> >> Signed-off-by: Jiang Xin >> --- >> diff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh >> @@ -0,0 +1,510 @@

[PATCH 1/1] Makefile: improve SPARSE_FLAGS customisation

2019-02-01 Thread Ramsay Jones
In order to enable greater user customisation of the SPARSE_FLAGS variable, we introduce a new SP_EXTRA_FLAGS variable to use for target specific settings. Without using the new variable, setting the SPARSE_FLAGS on the 'make' command-line would also override the value set by the target-specific

[PATCH 0/1] Using sparse in a CI job

2019-02-01 Thread Ramsay Jones
I suspect that the Makefile sparse target is not easy to use in a CI job, since the 'sparse' program (via cgcc -no-compile) does not exit with a non-zero value, even when issuing errors and warnings. The way I use sparse, this is not an issue. I run sparse over the master branch, check that the

Re: [PATCH v4 1/2] describe: setup working tree for --dirty

2019-02-01 Thread Junio C Hamano
Sebastian Staudt writes: > We don't use NEED_WORK_TREE when running the git-describe builtin, > since you should be able to describe a commit even in a bare repository. > However, the --dirty flag does need a working tree. Since we don't call > setup_work_tree(), it uses whatever directory we hap

Re: [PATCH v2 2/3] blame: add the ability to ignore commits and their changes

2019-02-01 Thread Barret Rhoden
On 2019-01-23 at 11:26 Junio C Hamano wrote: > Yeah, and if the original had two adjacent lines, and replacement > has three adjacent lines, the algorithm would not even know if > > - the first line in the original was split into first two in the >update and the second line was modified in

Re: [PATCH v4 1/2] describe: setup working tree for --dirty

2019-02-01 Thread Eric Sunshine
On Fri, Feb 1, 2019 at 8:55 AM Sebastian Staudt wrote: > We don't use NEED_WORK_TREE when running the git-describe builtin, > since you should be able to describe a commit even in a bare repository. > However, the --dirty flag does need a working tree. Since we don't call > setup_work_tree(), it u

Re: Worktree creation race

2019-02-01 Thread Eric Sunshine
On Fri, Feb 1, 2019 at 8:17 AM Duy Nguyen wrote: > I'm not going to bother you with code yet (although if you want, you > can check out branch worktree-name on my gitlab repo), but this is > what the user facing changes look like. Looking good? > > -- 8< -- > diff --git a/Documentation/git-worktre

Re: [PATCH v9 1/6] t5323: test cases for git-pack-redundant

2019-02-01 Thread Eric Sunshine
On Fri, Feb 1, 2019 at 11:22 AM Jiang Xin wrote: > Add test cases for git pack-redundant to validate new algorithm for git > pack-redundant. > > Signed-off-by: Jiang Xin > --- > diff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh > @@ -0,0 +1,510 @@ > +# Note: DO NOT run it in a su

[PATCH] http: cast result to FILE *

2019-02-01 Thread Dan McGregor
Commit 8dd2e88a92 ("http: support file handles for HTTP_KEEP_ERROR", 2019-01-10) introduced an implicit assumption that rewind, fileno, and fflush are functions. At least on FreeBSD fileno is not, and as such passing a void * failed. Explicitly cast result to a FILE * when using standard functions

Re: Broken interactive rebase text after some UTF-8 characters

2019-02-01 Thread Michal Nowak
On 02/01/19 06:30 PM, Junio C Hamano wrote: Michal Nowak writes: You already have that example. Just take the UTF-8 text in your original bug report, put it into something like int main(int argc, char **argv) { char utf8[] = "... your text here...";

Re: [PATCH v4 2/2] t6120: test for describe with a bare repository

2019-02-01 Thread Junio C Hamano
Sebastian Staudt writes: > This ensures that nothing breaks the basic functionality of describe for > bare repositories. Please note that --broken and --dirty need a working > tree. > > Signed-off-by: Sebastian Staudt > --- > t/t6120-describe.sh | 5 + > 1 file changed, 5 insertions(+) > >

Re: Worktree creation race

2019-02-01 Thread Junio C Hamano
Eric Sunshine writes: > Another possibility would be to skip the stat() and instead do the > mkdir() in a loop, incrementing the sequence number each time through > the loop. That should eliminate the race entirely (I think). Yeah, I think that is the only sensible option to rely on the atomicit

[PATCH v5 13/15] trace2:data: add subverb for rebase

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Signed-off-by: Jeff Hostetler --- builtin/rebase.c | 17 + 1 file changed, 17 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index 774264bae8..f5ac4fe2ea 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -850,6 +850,14 @@ int cmd_rebas

[PATCH v5 12/15] trace2:data: add subverb to reset command

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Signed-off-by: Jeff Hostetler --- builtin/reset.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/builtin/reset.c b/builtin/reset.c index 59898c972e..4e34c61401 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -340,6 +340,7 @@ int cmd_reset(int argc, const ch

[PATCH v5 07/15] trace2:data: add trace2 transport child classification

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Add trace2 child classification for transport processes. Signed-off-by: Jeff Hostetler --- connect.c | 3 +++ transport-helper.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/connect.c b/connect.c index 24281b6082..3c6f829a05 100644 --- a/connect.c +++ b/

[PATCH v5 10/15] trace2:data: pack-objects: add trace2 regions

2019-02-01 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee When studying the performance of 'git push' we would like to know how much time is spent at various parts of the command. One area that could cause performance trouble is 'git pack-objects'. Add trace2 regions around the three main actions taken in this command: 1. Enumerat

[PATCH v5 00/15] Trace2 tracing facility

2019-02-01 Thread Jeff Hostetler via GitGitGadget
V5 addresses: [] renames "verb" and "subverb" to "cmd_name" and "cmd_mode" in code and documentation. [] updates clang-format config to not complain about my for_each macros. [] update formatting around each use of my for_each macros. [] update the platform-specific process info commit to indicate

[PATCH v5 15/15] trace2: add for_each macros to clang-format

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Signed-off-by: Jeff Hostetler --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index de1c8b5c77..41d4cd23fd 100644 --- a/.clang-format +++ b/.clang-format @@ -149,7 +149,7 @@ Cpp11BracedListStyle: false #

[PATCH v5 14/15] trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Create unit tests for Trace2. Signed-off-by: Jeff Hostetler --- Makefile | 1 + t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/helper/test-trace2.c| 273 ++ t/t0210-trace2-normal.sh | 135

[PATCH v5 04/15] trace2:data: add trace2 regions to wt-status

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Add trace2_region_enter() and trace2_region_leave() calls around the various phases of a status scan. This gives elapsed time for each phase in the GIT_TR2_PERF and GIT_TR2_EVENT trace target. Also, these Trace2 calls now use s->repo rather than the_repository. Signed-off-

[PATCH v5 02/15] trace2: create new combined trace facility

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Create a new unified tracing facility for git. The eventual intent is to replace the current trace_printf* and trace_performance* routines with a unified set of git_trace2* routines. In addition to the usual printf-style API, trace2 provides higer-level event verbs with fix

[PATCH v5 09/15] trace2:data: add trace2 instrumentation to index read/write

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Add trace2 events to measure reading and writing the index. Signed-off-by: Jeff Hostetler --- read-cache.c | 51 ++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index bfff271a3d..

[PATCH v5 08/15] trace2:data: add trace2 hook classification

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Classify certain child processes as hooks. Signed-off-by: Jeff Hostetler --- builtin/am.c | 1 + builtin/receive-pack.c | 4 builtin/worktree.c | 1 + sequencer.c| 2 ++ transport.c| 1 + 5 files changed, 9 insertions(+) diff --g

[PATCH v5 11/15] trace2:data: add subverb to checkout command

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Signed-off-by: Jeff Hostetler --- builtin/checkout.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/builtin/checkout.c b/builtin/checkout.c index 6fadf412e8..f911c88bb4 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -262,6 +262,8 @@ static int check

[PATCH v5 01/15] trace2: Documentation/technical/api-trace2.txt

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Created design document for Trace2 feature. Signed-off-by: Jeff Hostetler --- Documentation/technical/api-trace2.txt | 1347 1 file changed, 1347 insertions(+) create mode 100644 Documentation/technical/api-trace2.txt diff --git a/Documentation/t

[PATCH v5 03/15] trace2: collect Windows-specific process information

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Add platform-specific interface to log information about the current process. On Windows, this interface is used to indicate whether the git process is running under a debugger and list names of the process ancestors. Information for other platforms is left for a future eff

[PATCH v5 06/15] trace2:data: add trace2 sub-process classification

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Add trace2 classification for long-running processes started in sub-process.c Signed-off-by: Jeff Hostetler --- sub-process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sub-process.c b/sub-process.c index 8d2a1707cf..3f4af93555 100644 --- a/sub-process.c +++ b/sub

[PATCH v5 05/15] trace2:data: add editor/pager child classification

2019-02-01 Thread Jeff Hostetler via GitGitGadget
From: Jeff Hostetler Add trace2 process classification for editor and pager child processes. Signed-off-by: Jeff Hostetler --- editor.c | 1 + pager.c | 1 + 2 files changed, 2 insertions(+) diff --git a/editor.c b/editor.c index c985eee1f9..71547674ab 100644 --- a/editor.c +++ b/editor.c @@

Re: [PATCH 6/8] checkout: add --cached option

2019-02-01 Thread Junio C Hamano
Duy Nguyen writes: > Of course we could just do --index and --worktree, each option > restores the respective part. Then it's combinable (and extensible in > the future). But then "git restore" means "git restore --index > --worktree" and typing "git restore --index" effectively removes the > def

Re: Broken interactive rebase text after some UTF-8 characters

2019-02-01 Thread Junio C Hamano
Michal Nowak writes: >> You already have that example. Just take the UTF-8 text in your original >> bug report, put it into something like >> >> int main(int argc, char **argv) >> { >> char utf8[] = "... your text here..."; >> >> printf("%.*s", (int)(sizeof(utf

Re: Broken interactive rebase text after some UTF-8 characters

2019-02-01 Thread Michal Nowak
On 02/01/19 03:33 PM, Johannes Schindelin wrote: Hi Michal, On Fri, 1 Feb 2019, Michal Nowak wrote: On Friday, February 1, 2019 at 8:38 AM, Johannes Schindelin wrote: On Thu, 31 Jan 2019, Junio C Hamano wrote: Phillip Wood writes: Are we misusing C formats? The C standard and POSIX

[PATCH v9 3/6] pack-redundant: delete redundant code

2019-02-01 Thread Jiang Xin
From: Sun Chao The objects in alt-odb are removed from `all_objects` twice in `load_all_objects` and `scan_alt_odb_packs`, remove it from the later function. Signed-off-by: Sun Chao Signed-off-by: Jiang Xin --- builtin/pack-redundant.c | 1 - 1 file changed, 1 deletion(-) diff --git a/built

[PATCH v9 4/6] pack-redundant: new algorithm to find min packs

2019-02-01 Thread Jiang Xin
From: Sun Chao When calling `git pack-redundant --all`, if there are too many local packs and too many redundant objects within them, the too deep iteration of `get_permutations` will exhaust all the resources, and the process of `git pack-redundant` will be killed. The following script could cr

[PATCH v9 5/6] pack-redundant: rename pack_list.all_objects

2019-02-01 Thread Jiang Xin
From: Jiang Xin New algorithm uses `pack_list.all_objects` to track remaining objects, so rename it to `pack_list.remaining_objects`. Signed-off-by: Jiang Xin Signed-off-by: Junio C Hamano --- builtin/pack-redundant.c | 38 +++--- 1 file changed, 19 insertions(

[PATCH v9 6/6] pack-redundant: consistent sort method

2019-02-01 Thread Jiang Xin
From: Jiang Xin SZEDER reported that test case t5323 has different test result on MacOS. This is because `cmp_pack_list_reverse` cannot give identical result when two pack being sorted has the same size of remaining_objects. Changes to the sorting function will make consistent test result for t5

[PATCH v9 2/6] pack-redundant: delay creation of unique_objects

2019-02-01 Thread Jiang Xin
From: Jiang Xin Instead of initializing unique_objects in `add_pack()`, copy from all_objects in `cmp_two_packs()`, when unwanted objects are removed from all_objects. This will save memory (no allocate memory for alt-odb packs), and run `llist_sorted_difference_inplace()` only once when removin

[PATCH v9 1/6] t5323: test cases for git-pack-redundant

2019-02-01 Thread Jiang Xin
From: Jiang Xin Add test cases for git pack-redundant to validate new algorithm for git pack-redundant. Signed-off-by: Jiang Xin Reviewed-by: SZEDER Gábor Helped-by: Eric Sunshine Reviewed-by: Sun Chao Signed-off-by: Junio C Hamano --- t/t5323-pack-redundant.sh | 510 ++

[PATCH v9 0/6] pack-redundant: new algorithm to find min packs

2019-02-01 Thread Jiang Xin
Sun Chao (my former colleague at Huawei) found a bug of git-pack-redundant. If there are too many packs and many of them overlap each other, running `git pack-redundant --all` will exhaust all memories and the process will be killed by kernel. There is a script in commit log of commit 3/6, which

Re: Broken interactive rebase text after some UTF-8 characters

2019-02-01 Thread Alban Gruin
Hi Michal, Le 01/02/2019 à 10:06, Michal Nowak a écrit : > Johannes, > > On Friday, February 1, 2019 at 8:38 AM, Johannes Schindelin > wrote: >> Hi, >> >> On Thu, 31 Jan 2019, Junio C Hamano wrote: >> >>> Phillip Wood writes: >>> > Are we misusing C formats? The C standard and PO

Re: Broken interactive rebase text after some UTF-8 characters

2019-02-01 Thread Alban Gruin
Hi Johannes, Le 01/02/2019 à 08:38, Johannes Schindelin a écrit : > Hi, > > On Thu, 31 Jan 2019, Junio C Hamano wrote: > >> Phillip Wood writes: >> Are we misusing C formats? >>> >>> The C standard and POSIX both say that the * refers to the maximum >>> number of bytes to print but it look

Re: [PATCH v4 5/8] evolve: add the change-table structure

2019-02-01 Thread Ramsay Jones
On 01/02/2019 03:09, sxe...@google.com wrote: > From: Stefan Xenos > > A change table stores a list of changes, and supports efficient lookup > from a commit hash to the list of changes that reference that commit > directly. > > It can be used to look up content commits or metacommits at the

Re: [PATCH v6 07/16] sequencer: refactor sequencer_add_exec_commands() to work on a todo_list

2019-02-01 Thread Phillip Wood
On 31/01/2019 14:30, Phillip Wood wrote: Hi Alban On 29/01/2019 15:01, Alban Gruin wrote: This refactors sequencer_add_exec_commands() to work on a todo_list to avoid redundant reads and writes to the disk. Instead of inserting the `exec' commands between the other commands and re-parsing the

Re: Submodules & worktree

2019-02-01 Thread Mateusz Loskot
On Fri, 1 Feb 2019 at 15:00, Ole Pinto wrote: > > Adding a worktree from a working copy with submodules doesn't work. > > In the config file I have > [submodule] > recurse = true > FYI, https://git-scm.com/docs/git-worktree#_bugs "Multiple checkout in general is still experimental, a

Re: [PATCH v4 0/7] Turn git add-i into built-in

2019-02-01 Thread Phillip Wood
Hi Slavica On 25/01/2019 12:37, Slavica Djukic wrote: Hi Phillip, Sorry for omitting you in Cc, again. I accidentally wrote yours and Ævar's email prefixed with Cc:, rather then separating them with comma, like Johannes said I should. Don't worry, thanks for emailing here. I've looked at th

Re: Broken interactive rebase text after some UTF-8 characters

2019-02-01 Thread Johannes Schindelin
Hi Michal, On Fri, 1 Feb 2019, Michal Nowak wrote: > On Friday, February 1, 2019 at 8:38 AM, Johannes Schindelin > wrote: > > > > On Thu, 31 Jan 2019, Junio C Hamano wrote: > > > >> Phillip Wood writes: > >> > >> >> Are we misusing C formats? > >> > > >> > The C standard and POSIX both say t

Fwd: Submodules & worktree

2019-02-01 Thread Ole Pinto
Adding a worktree from a working copy with submodules doesn't work. In the config file I have [submodule] recurse = true It that's not present, I don't find the problem. # Preparation $ git --version git version 2.20.1 $ cd /tmp/ $ git init main_repo Initialized empty Git reposito

[PATCH v4 1/2] describe: setup working tree for --dirty

2019-02-01 Thread Sebastian Staudt
We don't use NEED_WORK_TREE when running the git-describe builtin, since you should be able to describe a commit even in a bare repository. However, the --dirty flag does need a working tree. Since we don't call setup_work_tree(), it uses whatever directory we happen to be in. That's unlikely to ma

[PATCH v4 2/2] t6120: test for describe with a bare repository

2019-02-01 Thread Sebastian Staudt
This ensures that nothing breaks the basic functionality of describe for bare repositories. Please note that --broken and --dirty need a working tree. Signed-off-by: Sebastian Staudt --- t/t6120-describe.sh | 5 + 1 file changed, 5 insertions(+) diff --git a/t/t6120-describe.sh b/t/t6120-de

Re: Worktree creation race

2019-02-01 Thread Duy Nguyen
On Fri, Feb 01, 2019 at 02:06:43PM +0700, Duy Nguyen wrote: > worrying about races like this. The mkdir loop would be one way to go. > But I'm going to add a new option to let the user control this > directory name. This is necessary since this name is now exposed via > "worktrees/" reference space

Re: [PATCH v6 16/16] rebase--interactive: move transform_todo_file() to rebase--interactive.c

2019-02-01 Thread Phillip Wood
Hi Alban On 29/01/2019 15:01, Alban Gruin wrote: As transform_todo_file() is only needed inside of rebase--interactive.c, it is moved there from sequencer.c. I think I'd prefer to minimize the code under builtin and move this to rebase-interactive.c when it is modified earlier in the series.

Re: [PATCH v4 03/14] trace2: collect platform-specific process information

2019-02-01 Thread Jeff Hostetler
On 1/31/2019 6:15 PM, SZEDER Gábor wrote: On Wed, Jan 30, 2019 at 12:56:24PM -0800, Jeff Hostetler via GitGitGadget wrote: Add optional platform-specific code to log information about the current process. On Windows, this includes whether git.exe is running under a debugger and information a

Re: [PATCH v4 14/14] trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh

2019-02-01 Thread Jeff Hostetler
On 1/31/2019 6:41 PM, Junio C Hamano wrote: SZEDER Gábor writes: On Wed, Jan 30, 2019 at 12:56:34PM -0800, Jeff Hostetler via GitGitGadget wrote: Create unit tests for Trace2. diff --git a/t/t0212-trace2-event.sh b/t/t0212-trace2-event.sh new file mode 100755 index 00..517d5514d

Re: [PATCH v6 14/16] rebase-interactive: rewrite edit_todo_list() to handle the initial edit

2019-02-01 Thread Phillip Wood
Hi Alban This looks good apart from some missing error handling. On 29/01/2019 15:01, Alban Gruin wrote: edit_todo_list() is changed to work on a todo_list, and to handle the initial edition of the todo list (ie. making a backup of the todo list). It does not check for dropped commits yet, as

[PATCH v2] git-commit.txt: better description what it does

2019-02-01 Thread Nguyễn Thái Ngọc Duy
The description of git-commit jumps right into the commit content, which is important, but it fails to mention how the commit is "added" to the repository. Update the first paragraph saying a bit more about branch update to fill this gap. While at there, add a couple linkgit references when the co

Re: [PATCH v7 3/6] pack-redundant: new algorithm to find min packs

2019-02-01 Thread Jiang Xin
Junio C Hamano 于2019年2月1日周五 上午3:30写道: > > Jiang Xin writes: > > > From: Sun Chao > > > > When calling `git pack-redundant --all`, if there are too many local > > packs and too many redundant objects within them, the too deep iteration > > of `get_permutations` will exhaust all the resources, and

Re: [PATCH v7 1/6] t5323: test cases for git-pack-redundant

2019-02-01 Thread Jiang Xin
Eric Sunshine 于2019年2月1日周五 下午2:11写道: > > Everything below will be done inside master.git? Avoid cd'ing > > > around in random places in the test script, as a failure in any of > > > the steps that does cd would start later tests in an unexpected > > > place, if you can. > > > > The first 10 test

Re: Comparing rebase --am with --interactive via p3400

2019-02-01 Thread Elijah Newren
Hi Dscho, On Thu, Jan 31, 2019 at 10:04 PM Johannes Schindelin wrote: > > Hi Elijah, > > as discussed at the Contributors' Summit, I ran p3400 as-is (i.e. with the > --am backend) and then with --keep-empty to force the interactive backend > to be used. Here are the best of 10, on my relatively p

Re: Broken interactive rebase text after some UTF-8 characters

2019-02-01 Thread Michal Nowak
Johannes, On Friday, February 1, 2019 at 8:38 AM, Johannes Schindelin wrote: > Hi, > > On Thu, 31 Jan 2019, Junio C Hamano wrote: > >> Phillip Wood writes: >> >> >> Are we misusing C formats? >> > >> > The C standard and POSIX both say that the * refers to the maximum >> > number of bytes to

Re: [PATCH 3/3] It's C not C++ so variable length array should not be used [-Werror=vla] :,).

2019-02-01 Thread Eric Sunshine
On Fri, Feb 1, 2019 at 3:36 AM Shahzad Lone wrote: > diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c > @@ -197,9 +197,8 @@ static unsigned long write_large_blob_data(struct > git_istream *st, struct hashfi >const struct object_id *oid) > {

Re: [PATCH 2/3] ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] so fix that.

2019-02-01 Thread Eric Sunshine
On Fri, Feb 1, 2019 at 3:36 AM Shahzad Lone wrote: > diff --git a/pack-revindex.c b/pack-revindex.c > @@ -186,9 +186,9 @@ int find_revindex_position(struct packed_git *p, off_t > ofs) > struct revindex_entry *find_pack_revindex(struct packed_git *p, off_t ofs) > { > - > + int pos; >

[PATCH 1/3] [Enhancement] Improve internals / refactoring.

2019-02-01 Thread Shahzad Lone
Changed to ```consts``` and tried to save arithmetic cost where I could. Sorry my coding OCD bothered me when I didn't see them being ```consts```. --- builtin/diff.c | 2 +- builtin/pack-objects.c | 19 ++- builtin/pack-redundant.c | 4 ++-- pack-revindex.c

[PATCH 2/3] ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] so fix that.

2019-02-01 Thread Shahzad Lone
--- pack-revindex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pack-revindex.c b/pack-revindex.c index 202981b39c6b6..40651ec9fac2e 100644 --- a/pack-revindex.c +++ b/pack-revindex.c @@ -186,9 +186,9 @@ int find_revindex_position(struct packed_git *p, off_t ofs) str

[PATCH 3/3] It's C not C++ so variable length array should not be used [-Werror=vla] :,).

2019-02-01 Thread Shahzad Lone
--- builtin/pack-objects.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index c1ec9ef3232cb..3017beb8236fa 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -197,9 +197,8 @@ static unsigned long write_lar

Re: [PATCH] help: align the longest command in the command listing

2019-02-01 Thread Duy Nguyen
On Fri, Feb 1, 2019 at 2:42 PM Johannes Schindelin wrote: > > diff --git a/help.c b/help.c > > index ff05fd22df..520c9080e8 100644 > > --- a/help.c > > +++ b/help.c > > @@ -85,7 +85,8 @@ static void print_command_list(const struct cmdname_help > > *cmds, > > if (cmds[i].category & m

Re: Possible minor bug in Git

2019-02-01 Thread Angelo Melonas
Hi Torsten, Thank you so much for getting back to me. Unfortunately, I believe there is a misunderstanding, as I may have explained what I found to be a possible bug incorrectly. The file that is originally added (and then later modified) is never renamed or moved. As you will see below, when a u