Re: [PATCH v2 2/3] Setup working tree in describe

2019-01-26 Thread Sebastian Staudt
Am So., 27. Jan. 2019 um 01:22 Uhr schrieb Duy Nguyen : > > On Sun, Jan 27, 2019 at 3:51 AM Sebastian Staudt wrote: > > > > This ensures the given working tree is used for --dirty. > > > > The implementation of --broken uses diff-index which calls > > setup_work_tree() itself. > > It would be nice

Re: [PATCH v2 1/3] Add tests for describe with --work-tree

2019-01-26 Thread Sebastian Staudt
Am So., 27. Jan. 2019 um 01:07 Uhr schrieb Duy Nguyen : > > On Sun, Jan 27, 2019 at 3:51 AM Sebastian Staudt wrote: > > > > The dirty ones are already passing, but just because describe is comparing > > with the wrong working tree. > > > > Signed-off-by: Sebastian Staudt > > --- > > t/t6120-desc

Re: [PATCH v2 3/3] Add test for describe with a bare repository

2019-01-26 Thread Sebastian Staudt
Am So., 27. Jan. 2019 um 01:25 Uhr schrieb Duy Nguyen : > > On Sun, Jan 27, 2019 at 3:51 AM Sebastian Staudt wrote: > > > > This ensures that nothing breaks the basic functionality of describe for > > bare repositories. Please note that --broken and --dirty need a working > > tree. > > > > Signed-

Re: [PATCH v2 2/2] tests: add test for separate author and committer idents

2019-01-26 Thread Eric Sunshine
On Sat, Jan 26, 2019 at 3:53 AM Ævar Arnfjörð Bjarmason wrote: > Which, looking at this again, you'd only want if a previous test in the > file was leaking its state. That's not the case, so this isn't needed > and you can just apply this on top: > > test_expect_success \ > 'autho

Re: [PATCH v2] log,diff-tree: add --combined-with-paths options for merges with renames

2019-01-26 Thread brian m. carlson
On Fri, Jan 25, 2019 at 09:52:07AM -0800, Elijah Newren wrote: > On Fri, Jan 25, 2019 at 9:41 AM Derrick Stolee wrote: > > > > On 1/25/2019 11:54 AM, Elijah Newren wrote: > > > +test_expect_success '--combined-with-paths works with -z as well' ' > > > + printf "0f9645804ebb04cc3eef91f799eb7fb5

[PATCH 11/14] diff.c: convert -u|-p|--patch

2019-01-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/diff.c b/diff.c index 80b4af23d7..a4a40e4aa8 100644 --- a/diff.c +++ b/diff.c @@ -4870,6 +4870,13 @@ static int parse_objfind_opt(struct dif

[PATCH 05/14] parse-options: stop abusing 'callback' for lowlevel callbacks

2019-01-26 Thread Nguyễn Thái Ngọc Duy
Lowlevel callbacks have different function signatures. Add a new field in 'struct option' with the right type for lowlevel callbacks. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/blame.c| 2 +- builtin/merge.c| 2 +- builtin/update-index.c | 11

[PATCH 04/14] parse-options: add OPT_BITOP()

2019-01-26 Thread Nguyễn Thái Ngọc Duy
This is needed for diff_opt_parse() where we do value = (value & ~mask) | some_more; Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- parse-options.c | 7 +++ parse-options.h | 5 + 2 files changed, 12 insertions(+) diff --git a/parse-options.c b/parse-options.

[PATCH 02/14] parse-options: add one-shot mode

2019-01-26 Thread Nguyễn Thái Ngọc Duy
This is to help reimplement diff_opt_parse() using parse_options(). The behavior of parse_options() is changed to be the same as the other: - no argv0 in argv[], everything can be processed - argv[] must not be updated, it's the caller's job to do that - return the number of arguments processed -

[PATCH 01/14] parse-options.h: remove extern on function prototypes

2019-01-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- parse-options.h | 58 - 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/parse-options.h b/parse-options.h index 14fe32428e..f5e7ec7d23 100644 --- a/parse-options.

[PATCH 03/14] parse-options: disable option abbreviation with PARSE_OPT_KEEP_UNKNOWN

2019-01-26 Thread Nguyễn Thái Ngọc Duy
parse-options can unambiguously find an abbreviation only if it sees all available options. This is usually the case when you use parse_options(). But there are other callers like blame or shortlog which uses parse_options_start() in combination with a custom option parser, like rev-list. parse-opt

[PATCH 00/14] nd/diff-parseopt part 1

2019-01-26 Thread Nguyễn Thái Ngọc Duy
This is the first part of converting diff_opt_parse() to use parse_options(). Compared to the full series [1] I sent earlier, 03/76 is dropped and 02/14 is updated to allow KEEP_UNKNOWN and STOP_AT_NON_OPTION combination, but only for one shot mode. [1] https://public-inbox.org/git/20190117130615.

[PATCH 12/14] diff.c: convert -U|--unified

2019-01-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 2 +- diff.c | 23 --- parse-options.h| 5 +++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Documentation/diff

[PATCH 14/14] diff.c: convert --raw

2019-01-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/diff.c b/diff.c index 8f70101362..4bc9df7362 100644 --- a/diff.c +++ b/diff.c @@ -4898,6 +4898,9 @@ static void prep_parse_options(struct diff_o

[PATCH 13/14] diff.c: convert -W|--[no-]function-context

2019-01-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/diff.c b/diff.c index 093158244e..8f70101362 100644 --- a/diff.c +++ b/diff.c @@ -4896,6 +4896,8 @@ static void prep_parse_options(struct diff_

[PATCH 07/14] parse-options: allow ll_callback with OPTION_CALLBACK

2019-01-26 Thread Nguyễn Thái Ngọc Duy
OPTION_CALLBACK is much simpler/safer to use, but parse_opt_cb does not allow access to parse_opt_ctx_t, which sometimes is useful (e.g. to obtain the prefix). Extending parse_opt_cb to take parse_opt_cb could result in a lot of changes. Instead let's just allow ll_callback to be used with OPTION_

[PATCH 09/14] diff.h: avoid bit fields in struct diff_flags

2019-01-26 Thread Nguyễn Thái Ngọc Duy
Bitfield addresses cannot be passed around in a pointer. This makes it hard to use parse-options to set/unset them. Turn this struct to normal integers. This of course increases the size of this struct multiple times, but since we only have a handful of diff_options variables around, memory consump

[PATCH 08/14] diff.h: keep forward struct declarations sorted

2019-01-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/diff.h b/diff.h index b512d0477a..c872a41344 100644 --- a/diff.h +++ b/diff.h @@ -9,16 +9,16 @@ #include "object.h" #include "oidset.h"

[PATCH 10/14] diff.c: prepare to use parse_options() for parsing

2019-01-26 Thread Nguyễn Thái Ngọc Duy
This is a preparation step to start using parse_options() to parse diff/revision options instead of what we have now. There are a couple of good things from using parse_options(): - better help usage - easier to add new options - better completion support - help usage generation - better integrati

[PATCH 06/14] parse-options: avoid magic return codes

2019-01-26 Thread Nguyễn Thái Ngọc Duy
Give names to these magic negative numbers. Make parse_opt_ll_cb return an enum to make clear it can actually control parse_options() with different return values (parse_opt_cb can too, but nobody needs it). Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/merge.c

Re: [PATCH v2 3/3] Add test for describe with a bare repository

2019-01-26 Thread Duy Nguyen
On Sun, Jan 27, 2019 at 3:51 AM Sebastian Staudt wrote: > > 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 | 7 +++ > 1

Re: [PATCH v2 2/3] Setup working tree in describe

2019-01-26 Thread Duy Nguyen
On Sun, Jan 27, 2019 at 3:51 AM Sebastian Staudt wrote: > > This ensures the given working tree is used for --dirty. > > The implementation of --broken uses diff-index which calls > setup_work_tree() itself. It would be nice to have a test case covering --broken even if no fix is needed (so that

Checkout branch and prune everything related to previous checkout (incl. LFS remains)

2019-01-26 Thread Mateusz Loskot
Hi, I have a repo of a superproject with number of submodules. lots of files of both are in Git LFS. The repo comes with multiple long-lived release branches. The complete clone transfers 20 GB of Git and Git LFS objects. Checkout of master deflates the total repo to 40 GB in total, that is the ob

Re: [PATCH v2 1/3] Add tests for describe with --work-tree

2019-01-26 Thread Duy Nguyen
On Sun, Jan 27, 2019 at 3:51 AM Sebastian Staudt wrote: > > The dirty ones are already passing, but just because describe is comparing > with the wrong working tree. > > Signed-off-by: Sebastian Staudt > --- > t/t6120-describe.sh | 24 > 1 file changed, 24 insertions(+)

Re: [PATCH] fetch: prefer suffix substitution in compact fetch.output

2019-01-26 Thread Duy Nguyen
On Sat, Jan 26, 2019 at 4:36 AM Junio C Hamano wrote: > > Nguyễn Thái Ngọc Duy writes: > > > I have a remote named "jch" and it has a branch with the same name. And > > fetch.output is set to "compact". Fetching this remote looks like this > > > > From https://github.com/gitster/git > > + eb7

[PATCH v3] log,diff-tree: add --combined-all-names option

2019-01-26 Thread Elijah Newren
The combined diff format for merges will only list one filename, even if rename or copy detection is active. For example, with raw format one might see: ::100644 100644 100644 fabadb8 cc95eb0 4866510 MM describe.c ::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM bar.sh ::100644 100

Re: [PATCH] log,diff-tree: add --combined-with-paths options for merges with renames

2019-01-26 Thread Elijah Newren
On Fri, Jan 25, 2019 at 2:21 PM Junio C Hamano wrote: > > Elijah Newren writes: > > > Also, my first version of the patch actually showed all names, on all > > lines, but I found the heavy repetition really annoying, and not in > > keeping with how non-merge commits are handled (where original >

Re: [PATCH v2] log,diff-tree: add --combined-with-paths options for merges with renames

2019-01-26 Thread Elijah Newren
On Fri, Jan 25, 2019 at 11:51 AM Eric Sunshine wrote: > > On Fri, Jan 25, 2019 at 12:52 PM Elijah Newren wrote: > > On Fri, Jan 25, 2019 at 9:41 AM Derrick Stolee wrote: > > > On 1/25/2019 11:54 AM, Elijah Newren wrote: > > > > + printf "0f9645804ebb04cc3eef91f799eb7fb54d70cefb\0::100644 100

Re: [PATCH v2 4/4] built-in rebase: call `git am` directly

2019-01-26 Thread Alban Gruin
Hi Johannes, Le 18/01/2019 à 16:09, Johannes Schindelin via GitGitGadget a écrit : > -%<- > +static int run_am(struct rebase_options *opts) > +{ > -%<- > + > + if (!status) { > + return move_to_original_branch(opts); > + } > + > + if (is_directory(opts->state_dir)) > +

[PATCH] trace2: fix hdr-check warnings

2019-01-26 Thread Ramsay Jones
Signed-off-by: Ramsay Jones --- Hi Jeff, If you need to re-roll your 'jh/trace2' branch, could you please squash this into the relevant patches (sorry, I didn't look to see which patches need to be modified). Thanks! ATB, Ramsay Jones trace2/tr2_tgt.h | 4 trace2/tr2_tls.h | 2 ++ 2 f

[PATCH] test-xml-encode: fix sparse NULL pointer warnings

2019-01-26 Thread Ramsay Jones
Signed-off-by: Ramsay Jones --- Hi Johannes, If you need to re-roll your 'js/vsts-ci' branch, could you please squash this into the relevant patch (commit af7747e7c7 ("tests: optionally write results as JUnit-style .xml", 2019-01-23)). Thanks! ATB, Ramsay Jones t/helper/test-xml-encode.c |

[PATCH v2 1/3] Add tests for describe with --work-tree

2019-01-26 Thread Sebastian Staudt
The dirty ones are already passing, but just because describe is comparing with the wrong working tree. Signed-off-by: Sebastian Staudt --- t/t6120-describe.sh | 24 1 file changed, 24 insertions(+) diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh index d639d94696

[PATCH v2 2/3] Setup working tree in describe

2019-01-26 Thread Sebastian Staudt
This ensures the given working tree is used for --dirty. The implementation of --broken uses diff-index which calls setup_work_tree() itself. Signed-off-by: Sebastian Staudt --- builtin/describe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/describe.c b/builtin/describe.c index

[PATCH v2 3/3] Add test for describe with a bare repository

2019-01-26 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 | 7 +++ 1 file changed, 7 insertions(+) diff --git a/t/t6120-describe.sh b/t/t6120-

Re: [PATCH v4 04/21] ci: inherit --jobs via MAKEFLAGS in run-build-and-tests

2019-01-26 Thread Johannes Schindelin
Hi Junio, On Wed, 23 Jan 2019, Junio C Hamano wrote: > "Johannes Schindelin via GitGitGadget" > writes: > > > From: Johannes Schindelin > > > > Let's not decide in the generic ci/ script how many jobs to run in > > parallel; it is easy enough to hand that information down via the > > `MAKEFLAG

Re: [PATCH v4 03/21] ci/lib.sh: encapsulate Travis-specific things

2019-01-26 Thread Johannes Schindelin
Hi Junio, On Wed, 23 Jan 2019, Junio C Hamano wrote: > "Johannes Schindelin via GitGitGadget" > writes: > > > diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh > > index fe65144152..bcdcc71592 100755 > > --- a/ci/install-dependencies.sh > > +++ b/ci/install-dependencies.sh >

Re: [PATCH v4 08/10] midx: implement midx_repack()

2019-01-26 Thread Derrick Stolee
On 1/24/2019 4:52 PM, Derrick Stolee via GitGitGadget wrote: diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh index acc5e65ecc..d6c1353514 100755 --- a/t/t5319-multi-pack-index.sh +++ b/t/t5319-multi-pack-index.sh @@ -383,7 +383,8 @@ test_expect_success 'setup expire tests'

Re: [PATCH 2/2] Setup working tree in describe

2019-01-26 Thread Jeff King
On Sat, Jan 26, 2019 at 03:07:54PM +0100, Sebastian Staudt wrote: > Are you sure that it will fail without a working tree? > Is it even possible to have *no* working tree? > > I already tested this with some real life examples, e.g. > > git --git-dir /some/path/.git describe > > From inside

Re: [PATCH 2/2] Setup working tree in describe

2019-01-26 Thread Sebastian Staudt
Am Sa., 26. Jan. 2019 um 12:01 Uhr schrieb Duy Nguyen : > > On Sat, Jan 26, 2019 at 5:44 PM Sebastian Staudt wrote: > > > > This ensures the given working tree is used for --dirty and --broken. > > > > Signed-off-by: Sebastian Staudt > > --- > > builtin/describe.c | 2 ++ > > 1 file changed, 2 i

Re: [PATCH v2] rebase: move state_dir to tmp prior to deletion

2019-01-26 Thread Alban Gruin
Hi Ben, Le 26/01/2019 à 11:16, Ben Woosley a écrit : > From: Ben Woosley > > To avoid partial deletion / zombie rebases. > > Example behavior under partial deletion, after > Ctrl-Cing out of a standard rebase: > > $ git rebase target > First, rewinding head to replay your work on top o

Re: [PATCH 2/2] Setup working tree in describe

2019-01-26 Thread Duy Nguyen
On Sat, Jan 26, 2019 at 5:44 PM Sebastian Staudt wrote: > > This ensures the given working tree is used for --dirty and --broken. > > Signed-off-by: Sebastian Staudt > --- > builtin/describe.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/builtin/describe.c b/builtin/describe.c > in

[PATCH 1/2] Add tests for describe with --work-tree

2019-01-26 Thread Sebastian Staudt
The dirty ones are already passing, but just because describe is comparing with the wrong working tree. Signed-off-by: Sebastian Staudt --- t/t6120-describe.sh | 24 1 file changed, 24 insertions(+) diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh index d639d94696

[PATCH 2/2] Setup working tree in describe

2019-01-26 Thread Sebastian Staudt
This ensures the given working tree is used for --dirty and --broken. Signed-off-by: Sebastian Staudt --- builtin/describe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/describe.c b/builtin/describe.c index cc118448ee..ba1a0b199b 100644 --- a/builtin/describe.c +++ b/builtin/de

[PATCH v2] rebase: move state_dir to tmp prior to deletion

2019-01-26 Thread Ben Woosley
From: Ben Woosley To avoid partial deletion / zombie rebases. Example behavior under partial deletion, after Ctrl-Cing out of a standard rebase: $ git rebase target First, rewinding head to replay your work on top of it... Applying: [...] ^C $ git status rebase in progre

Re: [PATCH v2 2/2] tests: add test for separate author and committer idents

2019-01-26 Thread Ævar Arnfjörð Bjarmason
On Sat, Jan 26 2019, William Hubbs wrote: > On Sat, Jan 26, 2019 at 12:05:08AM +0100, Ævar Arnfjörð Bjarmason wrote: >> >> On Fri, Jan 25 2019, William Hubbs wrote: > > ... > >> > + sane_unset GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL && >> > + sane_unset GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL && >> >>