[PATCH v7 10/13] help: use command-list.txt for the source of guides

2018-05-10 Thread Nguyễn Thái Ngọc Duy
The help command currently hard codes the list of guides and their summary in C. Let's move this list to command-list.txt. This lets us extract summary lines from Documentation/git*.txt. This also potentially lets us list guides in git.txt, but I'll leave that for now. Signed-off-by: Nguyễn Thái

[PATCH v7 13/13] completion: allow to customize the completable command list

2018-05-10 Thread Nguyễn Thái Ngọc Duy
By default we show porcelain, external commands and a couple others that are also popular. If you are not happy with this list, you can now customize it. See the big comment block for details. PS. perhaps I should make aliases a group too, which makes it possible to _not_ complete aliases by

[PATCH v7 00/13] Keep all info in command-list.txt in git binary

2018-05-10 Thread Nguyễn Thái Ngọc Duy
v7 is mostly code cleanup plus one more change: git-completion.bash now always checks completion.commands config key. This makes it much more convenient to customize the command complete list. You only have to fall back to setting $GIT_COMPLETION_CMD_GROUPS when you have very special needs.

[PATCH v7 03/13] help: use command-list.h for common command list

2018-05-10 Thread Nguyễn Thái Ngọc Duy
The previous commit added code generation for all_cmd_desc[] which includes almost everything we need to generate common command list. Convert help code to use that array instead and drop common_cmds[] array. The description of each common command group is removed from command-list.txt. This

[PATCH v7 04/13] Remove common-cmds.h

2018-05-10 Thread Nguyễn Thái Ngọc Duy
After the last patch, common-cmds.h is no longer used (and it was actually broken). Remove all related code. command-list.h will take its place from now on. Signed-off-by: Nguyễn Thái Ngọc Duy --- .gitignore | 1 - Makefile| 17 ++---

[PATCH v7 02/13] generate-cmds.sh: export all commands to command-list.h

2018-05-10 Thread Nguyễn Thái Ngọc Duy
The current generate-cmds.sh generates just enough to print "git help" output. That is, it only extracts help text for common commands. The script is now updated to extract help text for all commands and keep command classification a new file, command-list.h. This will be useful later: - "git

[PATCH v7 07/13] completion: implement and use --list-cmds=main,others

2018-05-10 Thread Nguyễn Thái Ngọc Duy
Instead of parsing "git help -a" output, which is tricky to get right, less elegant and also slow, make git provide the list in a machine-friendly form. This adds two separate listing types, main and others, instead of just "all" for more flexibility. Signed-off-by: Nguyễn Thái Ngọc Duy

[PATCH v7 05/13] git.c: convert --list-* to --list-cmds=*

2018-05-10 Thread Nguyễn Thái Ngọc Duy
Even if these are hidden options, let's make them a bit more generic since we're introducing more listing types shortly. The code is structured to allow combining multiple listing types together because we will soon add more types the 'builtins'. 'parseopt' remains separate because it has

[PATCH v7 09/13] help: add "-a --verbose" to list all commands with synopsis

2018-05-10 Thread Nguyễn Thái Ngọc Duy
This lists all recognized commands [1] by category. The group order follows closely git.txt. [1] We may actually show commands that are not built (e.g. if you set NO_PERL you don't have git-instaweb but it's still listed here). I ignore the problem because on Linux a git package could be split

[PATCH v7 06/13] git --list-cmds: collect command list in a string_list

2018-05-10 Thread Nguyễn Thái Ngọc Duy
Instead of printing the command directly one by one, keep them in a list and print at the end. This allows more modification before we print out (e.g. sorting, removing duplicates or even excluding some items). Signed-off-by: Nguyễn Thái Ngọc Duy --- git.c | 22

[PATCH v7 08/13] git: support --list-cmds=list-

2018-05-10 Thread Nguyễn Thái Ngọc Duy
This allows us to select any group of commands by a category defined in command-list.txt. This is an internal/hidden option so we don't have to be picky about the category name or worried about exposing too much. This will be used later by git-completion.bash to retrieve certain command groups.

[PATCH v7 11/13] command-list.txt: documentation and guide line

2018-05-10 Thread Nguyễn Thái Ngọc Duy
This is intended to help anybody who needs to update command-list.txt. It gives a brief introduction of all attributes a command can take. Signed-off-by: Nguyễn Thái Ngọc Duy --- command-list.txt | 44 1 file changed, 44

[PATCH v7 12/13] completion: let git provide the completable command list

2018-05-10 Thread Nguyễn Thái Ngọc Duy
Instead of maintaining a separate list of command classification, which often could go out of date, let's centralize the information back in git. While the function in git-completion.bash implies "list porcelain commands", that's not exactly what it does. It gets all commands (aka

[PATCH v7 01/13] generate-cmds.sh: factor out synopsis extract code

2018-05-10 Thread Nguyễn Thái Ngọc Duy
This makes it easier to reuse the same code in another place (very soon). Signed-off-by: Nguyễn Thái Ngọc Duy --- generate-cmdlist.sh | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh index

Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-10 Thread Junio C Hamano
Stefan Beller writes: > So this would go with the latest sb/object-store-alloc ? > > My impression was that we never call repo_clear() on > the_repository, which would allow us to special case > the_repository further just as I did in v2 of that series[1] by > having static

Re: [PATCH 1/2] object.c: free replace map in raw_object_store_clear

2018-05-10 Thread Junio C Hamano
Stefan Beller writes: > The replace map for objects was missed to free in the object store in > the conversion of 174774cd519 (Merge branch 'sb/object-store-replace', > 2018-05-08) I need a bit of clarification wrt the above. The above makes it sound like the merge needed a

Re: Regression in patch add?

2018-05-10 Thread Oliver Joseph Ash
I just ran into a similar problem: https://stackoverflow.com/questions/50258565/git-editing-hunks-fails-when-file-has-other-hunks I can reproduce on 2.17.0. The issue doesn't occur on 2.16.2, however. Is this a bug?

Re: Generate more revenue from Git

2018-05-10 Thread Michal Sapozhnikov
Hi, I am writing with the hope of talking to the appropriate person who handles the app's monetization. If it makes sense to have a call, let me know how your schedule looks. Best Regards, -- Michal Sapozhnikov | Business Manager, Luminati SDK | +972-50-2826778 | Skype: live:michals_43

Re: [PATCH 1/2] git-credential-netrc: adapt to test framework for git

2018-05-10 Thread Junio C Hamano
Luis Marsano writes: > until this change, git-credential-netrc did not test in a repository > this change reuses the main test framework, which provides such tests > specific changes Sorry, but I cannot quite parse what the above is trying to say. > - switch to

Re: [PATCH 2/2] git-credential-netrc: accept gpg option

2018-05-10 Thread Junio C Hamano
Luis Marsano writes: > git-credential-netrc was hardcoded to decrypt with 'gpg' regardless of the > gpg.program option > this now uses the gpg command option if set, else, the gpg.program option set > in the git repository or global configuration, else defaults to 'gpg'

[PATCH] completion: add diff --color-moved and config diff.colorMoved

2018-05-10 Thread John Marshall
Complete the --color-moved option wherever we complete --diff-algorithm. Signed-off-by: John Marshall --- Complete this recently-added option in a slightly over-the-top number of places. Patch based on the maint branch. Cheers, John

Re: [PATCH] fast-export: avoid NULL pointer arithmetic

2018-05-10 Thread Junio C Hamano
René Scharfe writes: > The standard says about uintptr_t that "any valid pointer to void can > be converted to this type, then converted back to pointer to void, and > the result will compare equal to the original pointer". So void * -> > uintptr_t -> void * is a proper roundtrip,

Re: [PATCH] fast-export: avoid NULL pointer arithmetic

2018-05-10 Thread René Scharfe
Am 09.05.2018 um 23:06 schrieb René Scharfe: > Clang 6 reports the following warning, which is turned into an error in a > DEVELOPER build: > > builtin/fast-export.c:162:28: error: performing pointer arithmetic on a > null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]

Re: [PATCH 2/2] replace-object.c: remove the_repository from prepare_replace_object

2018-05-10 Thread Junio C Hamano
Stefan Beller writes: > This was missed in 5982da9d2ce (replace-object: allow > prepare_replace_object to handle arbitrary repositories, 2018-04-11) > > Technically the code works correctly as the replace_map is the same > size in different repositories, however it is hard to

Re: Regression in patch add?

2018-05-10 Thread Martin Ågren
On 10 May 2018 at 12:41, Oliver Joseph Ash wrote: > I just ran into a similar problem: > https://stackoverflow.com/questions/50258565/git-editing-hunks-fails-when-file-has-other-hunks > > I can reproduce on 2.17.0. The issue doesn't occur on 2.16.2, however. > > Is this a

Re: [PATCH 2/2] replace-object.c: remove the_repository from prepare_replace_object

2018-05-10 Thread Jeff King
On Thu, May 10, 2018 at 07:23:13PM +0900, Junio C Hamano wrote: > This one was doing > > ptr = xmalloc(sizeof(*another_ptr)) > > and it was OK because ptr and another_ptr happened to be of the same > type. I wonder if we are making it safer, or making it more obscure > to seasoned C

Re: Regression in patch add?

2018-05-10 Thread Oliver Joseph Ash
> does your test involve unusual file systems, funny characters in filenames, > ..? You are on some sort of Linux, right? I'm running macOS 10.13.4. I don't have any unusual file system setup, as far as I'm aware. The filename in my test case is simply `foo`. I tried the steps you suggested:

Re: [PATCH v4 6/6] get_short_oid: document & warn if we ignore the type selector

2018-05-10 Thread Martin Ågren
On 10 May 2018 at 14:43, Ævar Arnfjörð Bjarmason wrote: > The SHA1 prefix 06fa currently matches no blobs in git.git. When > disambiguating short SHA1s we've been quietly ignoring the user's type > selector as a fallback mechanism, this was intentionally added in > 1ffa26c461

[PATCH] t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX

2018-05-10 Thread SZEDER Gábor
The two JGit tests 'we can read jgit bitmaps' and 'jgit can read our bitmaps' in 't5310-pack-bitmaps.sh' fail when run with GIT_TEST_SPLIT_INDEX=YesPlease. Both tests create a clone of the test repository to check bitmap interoperability with JGit. With split indexes enabled the index in the

[PATCH] apply: clarify "-p" documentation

2018-05-10 Thread Jeff King
On Fri, Apr 27, 2018 at 12:40:05PM -0500, kelly elton wrote: > > -p > > Remove leading slashes from traditional diff paths. The default is 1. > > This suggests to me the following outcomes: > 1) home/user/repos/myrepo with -p1 becomes home/user/repos/myrepo > 2) home/user/repos/myrepo with -p2

[PATCH v4 3/6] git-p4: change "commitish" typo to "committish"

2018-05-10 Thread Ævar Arnfjörð Bjarmason
This was the only occurrence of "commitish" in the tree, but as the log will reveal we've had others in the past. Fixes up code added in 00ad6e3182 ("git-p4: work with a detached head", 2015-11-21). Signed-off-by: Ævar Arnfjörð Bjarmason --- git-p4.py | 6 +++--- 1 file

[PATCH v4 0/6] get_short_oid UI improvements

2018-05-10 Thread Ævar Arnfjörð Bjarmason
This is like v3 except all the patches to the peel syntax & docs have been dropped, which were controversial. I think it's worthwhile to re-work that, but I don't have time for that now, so I'm submitting this. Maybe I'll have time in the future to re-work the rest, but then I can base it on top

[PATCH v4 2/6] sha1-array.h: align function arguments

2018-05-10 Thread Ævar Arnfjörð Bjarmason
The arguments weren't lined up with the opening parenthesis. Fixes up code added in aae0caf19e ("sha1-array.h: align function arguments", 2018-04-30). Signed-off-by: Ævar Arnfjörð Bjarmason --- sha1-array.c | 4 ++-- sha1-array.h | 4 ++-- 2 files changed, 4 insertions(+), 4

[PATCH v4 6/6] get_short_oid: document & warn if we ignore the type selector

2018-05-10 Thread Ævar Arnfjörð Bjarmason
The SHA1 prefix 06fa currently matches no blobs in git.git. When disambiguating short SHA1s we've been quietly ignoring the user's type selector as a fallback mechanism, this was intentionally added in 1ffa26c461 ("get_short_sha1: list ambiguous objects on error", 2016-09-26). I think that

[PATCH v4 1/6] sha1-name.c: remove stray newline

2018-05-10 Thread Ævar Arnfjörð Bjarmason
This stray newline was accidentally introduced in d2b7d9c7ed ("sha1_name: convert disambiguate_hint_fn to take object_id", 2017-03-26). Signed-off-by: Ævar Arnfjörð Bjarmason --- sha1-name.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sha1-name.c b/sha1-name.c index

[PATCH v4 4/6] sha1-name.c: move around the collect_ambiguous() function

2018-05-10 Thread Ævar Arnfjörð Bjarmason
A subsequent change will make use of this static function in the get_short_oid() function, which is defined above where the collect_ambiguous() function is now. Without this we'd then have a compilation error due to a forward declaration. Signed-off-by: Ævar Arnfjörð Bjarmason

Re: Regression in patch add?

2018-05-10 Thread Phillip Wood
On 10/05/18 13:17, Martin Ågren wrote: > > On 10 May 2018 at 12:41, Oliver Joseph Ash wrote: >> I just ran into a similar problem: >> https://stackoverflow.com/questions/50258565/git-editing-hunks-fails-when-file-has-other-hunks >> >> I can reproduce on 2.17.0. The issue

Re: Missing --relative documentation

2018-05-10 Thread Jeff King
On Fri, Apr 27, 2018 at 12:24:26PM -0500, kelly elton wrote: > git format-patch is missing documentation for --relative. > There is also no auto complete(or tab complete, whatever it's called) > for the --relative switch/argument. The missing documentation is due to the ancient d4cb003fff

Re: Regression in patch add?

2018-05-10 Thread Oliver Joseph Ash
(Apologies, I accidentally sent this as a reply to the original post, instead of your email. I'm new to this!) > does your test involve unusual file systems, funny characters in filenames, > ..? You are on some sort of Linux, right? I'm running macOS 10.13.4. I don't have any unusual file

Re: Regression in patch add?

2018-05-10 Thread Martin Ågren
On 10 May 2018 at 15:16, Oliver Joseph Ash wrote: > (Apologies, I accidentally sent this as a reply to the original post, instead > of your email. I'm new to this!) (No worries.) ;-) >> does your test involve unusual file systems, funny characters in filenames, >> ..?

[PATCH v2] add status config and command line options for rename detection

2018-05-10 Thread Ben Peart
After performing a merge that has conflicts, git status will by default attempt to detect renames which causes many objects to be examined. In a virtualized repo, those objects do not exist locally so the rename logic triggers them to be fetched from the server. This results in the status call

Re: [PATCH 0/9] completion: avoid hard coding config var list

2018-05-10 Thread Duy Nguyen
On Thu, May 10, 2018 at 4:19 PM, Nguyễn Thái Ngọc Duy wrote: > (on top of nd/command-list) Oh.. and it does make use of C99 designated initializer feature. I could go with out it, but since git-clean has used it for some time without anybody complaining, I figure I should take

[PATCH v4 5/6] get_short_oid: sort ambiguous objects by type, then SHA-1

2018-05-10 Thread Ævar Arnfjörð Bjarmason
Change the output emitted when an ambiguous object is encountered so that we show tags first, then commits, followed by trees, and finally blobs. Within each type we show objects in hashcmp() order. Before this change the objects were only ordered by hashcmp(). The reason for doing this is that

[PATCH 4/9] help: add --config to list all available config

2018-05-10 Thread Nguyễn Thái Ngọc Duy
Sometimes it helps to list all available config vars so the user can search for something they want. The config man page can also be used but it's harder to search if you want to focus on the variable name, for example. Signed-off-by: Nguyễn Thái Ngọc Duy ---

[PATCH 5/9] advice: keep config name in camelCase in advice_config[]

2018-05-10 Thread Nguyễn Thái Ngọc Duy
For parsing, we don't really need this because the main config parser will lowercase everything so we can do exact matching. But this array now is also used for printing in `git help --config`. Keep camelCase so we have a nice printout. Signed-off-by: Nguyễn Thái Ngọc Duy ---

Re: [PATCH 0/1] Fix UX issue with commit-graph.lock

2018-05-10 Thread Derrick Stolee
On 5/10/2018 3:00 AM, Junio C Hamano wrote: Derrick Stolee writes: We use the lockfile API to avoid multiple Git processes from writing to the commit-graph file in the .git/objects/info directory. In some cases, this directory may not exist, so we check for its

[PATCH 1/2] t5516-fetch-push: fix 'push with dry-run' test

2018-05-10 Thread SZEDER Gábor
In a while-at-it cleanup replacing a 'cd dir && <...> && cd ..' with a subshell, commit 28391a80a9 (receive-pack: allow deletion of corrupt refs, 2007-11-29) also moved the assignment of the $old_commit variable to that subshell. This variable, however, is used outside of that subshell as a

[PATCH 2/2] t5516-fetch-push: fix broken &&-chain

2018-05-10 Thread SZEDER Gábor
b2dc968e60 (t5516: refactor oddball tests, 2008-11-07) accidentaly broke the &&-chain in the test 'push does not update local refs on failure', but since it was in a subshell, chain-lint couldn't notice it. Signed-off-by: SZEDER Gábor --- t/t5516-fetch-push.sh | 2 +- 1

Re: Regression in patch add?

2018-05-10 Thread Oliver Joseph Ash
You found the problem Phillip! My editor was trimming trailing white space, which breaks the context line. I had tried to use an alternative editor to account for any editor specific behaviour, but it turns out both the editors I tested in were doing this! I suspect this change in behaviour

[PATCH 2/9] grep: keep all colors in an array

2018-05-10 Thread Nguyễn Thái Ngọc Duy
This is more inline with how we handle color slots in other code. It also allows us to get the list of configurable color slots later. Signed-off-by: Nguyễn Thái Ngọc Duy --- grep.c | 106 ++--- grep.h | 21 +++- 2

[PATCH 0/9] completion: avoid hard coding config var list

2018-05-10 Thread Nguyễn Thái Ngọc Duy
This is part of the attempt to automate more in git-completion.bash. This series is about making 'git' binary provide the list of recognized configuration variables and feeding it to git-completion.bash. The approach is less than ideal. Unlike parse-options, we don't have a reliable source for

[PATCH 7/9] completion: drop the hard coded list of config vars

2018-05-10 Thread Nguyễn Thái Ngọc Duy
The new help option --config-for-completion is a machine friendlier version of --config where all the placeholders and wildcards are dropped, leaving only the good, completable prefixes for git-completion.bash to consume. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/help.c

[PATCH 3/9] fsck: factor out msg_id_info[] lazy initialization code

2018-05-10 Thread Nguyễn Thái Ngọc Duy
This array will be used by some other function than parse_msg_id() in the following commit. Factor out this prep code so it could be called from that one. Signed-off-by: Nguyễn Thái Ngọc Duy --- fsck.c | 38 ++ 1 file changed, 22

[PATCH 6/9] am: move advice.amWorkDir parsing back to advice.c

2018-05-10 Thread Nguyễn Thái Ngọc Duy
The only benefit from this move (apart from cleaner code) is that advice.amWorkDir should now show up in `git help --config`. There should be no regression since advice config is always read by the git_default_config(). While at there, use advise() like other code. We now get "hint: " prefix and

[PATCH 8/9] completion: support case-insensitive config vars just a bit

2018-05-10 Thread Nguyễn Thái Ngọc Duy
config variable names are technically case-insensitive while this case construct is by default case-sensitive. Moving it to case-insensitive could be a lot more work. Instead let's just accept the form that is more likely to show up in practice. Signed-off-by: Nguyễn Thái Ngọc Duy

[PATCH 1/9] Add and use generic name->id mapping code for color slot parsing

2018-05-10 Thread Nguyễn Thái Ngọc Duy
Instead of hard coding the name-to-id mapping in C code, keep it in an array and use a common function to do the parsing. This reduces code and also allows us to list all possible color slots later. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/branch.c | 28

[PATCH 9/9] log-tree: allow to customize 'grafted' color

2018-05-10 Thread Nguyễn Thái Ngọc Duy
Commit 76f5df305b (log: decorate grafted commits with "grafted" - 2011-08-18) lets us decorate grafted commits but I forgot about the color.decorate.* config. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/config.txt | 3 ++- log-tree.c | 1 + 2 files

Re: [PATCH 4/4] submodule: port submodule subcommand 'foreach' from shell to C

2018-05-10 Thread Junio C Hamano
Stefan Beller writes: > +static void runcommand_in_submodule_cb(const struct cache_entry *list_item, > +void *cb_data) > +{ > + struct cb_foreach *info = cb_data; > + const char *path = list_item->name; > + const struct

Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-10 Thread Duy Nguyen
On Wed, May 9, 2018 at 8:00 PM, Duy Nguyen wrote: > discard_index(repo->index); > if (repo->index != _index) > FREE_AND_NULL(repo->index); > >> What is your use case of repo_clear(the_repository)? > > No actual use case right now. See [1] for the code that triggered >

Re: [PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-10 Thread Jeff King
On Thu, May 10, 2018 at 01:21:19PM +0900, Junio C Hamano wrote: > When diagnosing such an error, we would give hints. The hint would > show possible objects that the user could have meant with X. The > ^{} suffix given to it may be used to limit the hints to > subset of the objects that the

Re: [PATCH 0/4] doc: cleaning up instances of \--

2018-05-10 Thread Jeff King
On Wed, Apr 18, 2018 at 01:24:55PM +0900, Junio C Hamano wrote: > Martin Ågren writes: > > > This is a patch series to convert \-- to -- in our documentation. The > > first patch is a reiteration of 1c262bb7b2 (doc: convert \--option to > > --option, 2015-05-13) to fix

Re: [PATCH 2/2] builtin/grep.c: teach '-o', '--only-matching' to 'git-grep'

2018-05-10 Thread Jeff King
On Wed, May 09, 2018 at 07:00:10PM -0700, Taylor Blau wrote: > > - they test with context (-C3) for us. It looks like GNU grep omits > >context lines with "-o", but we show a bunch of blank lines. This is > >I guess a bug (though it seems kind of an odd combination to specify > >in

[PATCH v2] repository: fix free problem with repo_clear(the_repository)

2018-05-10 Thread Nguyễn Thái Ngọc Duy
the_repository is special. One of the special things about it is that it does not allocate a new index_state object like submodules but points to the global the_index variable instead. As a global variable, the_index cannot be free()'d. Add an exception for this in repo_clear(). In the future

Re: [PATCH v2 0/5] getting rid of most "static struct lock_file"s

2018-05-10 Thread Junio C Hamano
Jeff King writes: > I don't think it's worth re-rolling, but one thing to think about for > future cleanups: you split the patches by touched area, not by > functionality. So the first three patches have a "while we're here..." > that has to explain why dropping the "static" is

Re: [PATCH v5 5/7] builtin/grep.c: add '--column' option to 'git-grep(1)'

2018-05-10 Thread Junio C Hamano
René Scharfe writes: > Am 10.05.2018 um 02:04 schrieb Junio C Hamano: > ... >> $ git grep -v second >> $ git grep --not -e second >> >> may hit all lines in this message (except for the obvious two >> lines), but we cannot say which column we found a hit. I am >>

Re: [PATCH 0/1] Fix UX issue with commit-graph.lock

2018-05-10 Thread Junio C Hamano
Derrick Stolee writes: > We use the lockfile API to avoid multiple Git processes from writing to > the commit-graph file in the .git/objects/info directory. In some cases, > this directory may not exist, so we check for its existence. > > The existing code does the

Re: [PATCH v2 0/5] getting rid of most "static struct lock_file"s

2018-05-10 Thread Martin Ågren
On 10 May 2018 at 08:01, Junio C Hamano wrote: > Jeff King writes: > >> I don't think it's worth re-rolling, but one thing to think about for >> future cleanups: you split the patches by touched area, not by >> functionality. So the first three patches have a

Re: [PATCH] t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX

2018-05-10 Thread Jeff King
On Thu, May 10, 2018 at 03:58:52PM +0200, SZEDER Gábor wrote: > The two JGit tests 'we can read jgit bitmaps' and 'jgit can read our > bitmaps' in 't5310-pack-bitmaps.sh' fail when run with > GIT_TEST_SPLIT_INDEX=YesPlease. Both tests create a clone of the test > repository to check bitmap

Re: [PATCH v4 5/6] get_short_oid: sort ambiguous objects by type, then SHA-1

2018-05-10 Thread Jeff King
On Thu, May 10, 2018 at 12:43:02PM +, Ævar Arnfjörð Bjarmason wrote: > Now we'll instead show: > > hint: e8f2650052 tag v2.17.0 > hint: e8f21caf94 commit 2013-06-24 - bash prompt: print unique detached > HEAD abbreviated object name > hint: e8f26250fa commit 2017-02-03 -

Re: [PATCH v4 6/6] get_short_oid: document & warn if we ignore the type selector

2018-05-10 Thread Jeff King
On Thu, May 10, 2018 at 12:03:22PM -0400, Jeff King wrote: > And finally, your 06fa example for me shows behavior that's either > buggy, or I'm just confused. I get: > > $ git rev-parse 06fa^{blob} > error: short SHA1 06fa is ambiguous > hint: The candidates are: > hint: 06fa2b7c2b tag

Re: [PATCH v4 3/6] git-p4: change "commitish" typo to "committish"

2018-05-10 Thread Luke Diamand
On 10 May 2018 at 13:43, Ævar Arnfjörð Bjarmason wrote: > This was the only occurrence of "commitish" in the tree, but as the > log will reveal we've had others in the past. Fixes up code added in > 00ad6e3182 ("git-p4: work with a detached head", 2015-11-21). > > Signed-off-by:

Re: [PATCH v3 13/13] alloc: allow arbitrary repositories for alloc functions

2018-05-10 Thread Duy Nguyen
On Wed, May 9, 2018 at 9:20 PM, Stefan Beller wrote: > On Wed, May 9, 2018 at 10:18 AM, Duy Nguyen wrote: >> >> If you want to reproduce, this is what I used to test this with. >> >> https://gist.github.com/pclouds/86a2df6c28043f1b6fa3d4e72e7a1276 > > This

Re: [PATCH v4 6/6] get_short_oid: document & warn if we ignore the type selector

2018-05-10 Thread Jeff King
On Thu, May 10, 2018 at 12:03:22PM -0400, Jeff King wrote: > But some cases _don't_ issue an error. For example, try this: > > $ git log ..06faf > > which returns an empty output! We return the single matching tree, even > though the ".." triggers the commit hint. The revision machinery just

Re: [PATCH] t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX

2018-05-10 Thread SZEDER Gábor
On Thu, May 10, 2018 at 4:34 PM, Jeff King wrote: > On Thu, May 10, 2018 at 03:58:52PM +0200, SZEDER Gábor wrote: >> Since testing bitmaps doesn't need a worktree in the first place, >> let's just create bare clones for the two JGit tests, so the cloned >> won't have an index, and

Re: [PATCH v4 2/6] sha1-array.h: align function arguments

2018-05-10 Thread Jeff King
On Thu, May 10, 2018 at 12:42:59PM +, Ævar Arnfjörð Bjarmason wrote: > The arguments weren't lined up with the opening parenthesis. Fixes up > code added in aae0caf19e ("sha1-array.h: align function arguments", > 2018-04-30). I think that's this patch. :) Presumably you meant 910650d2f8

Re: [PATCH 2/2] replace-object.c: remove the_repository from prepare_replace_object

2018-05-10 Thread Derrick Stolee
On 5/10/2018 7:56 AM, Jeff King wrote: On Thu, May 10, 2018 at 07:23:13PM +0900, Junio C Hamano wrote: This one was doing ptr = xmalloc(sizeof(*another_ptr)) and it was OK because ptr and another_ptr happened to be of the same type. I wonder if we are making it safer, or making it

[PATCH v2] pack-format.txt: more details on pack file format

2018-05-10 Thread Nguyễn Thái Ngọc Duy
The current document mentions OBJ_* constants without their actual values. A git developer would know these are from cache.h but that's not very friendly to a person who wants to read this file to implement a pack file parser. Similarly, the deltified representation is not documented at all (the

Re: [PATCH v4 6/6] get_short_oid: document & warn if we ignore the type selector

2018-05-10 Thread Jeff King
On Thu, May 10, 2018 at 12:43:03PM +, Ævar Arnfjörð Bjarmason wrote: > The SHA1 prefix 06fa currently matches no blobs in git.git. When > disambiguating short SHA1s we've been quietly ignoring the user's type > selector as a fallback mechanism, this was intentionally added in > 1ffa26c461

Re: [PATCH v4 0/6] get_short_oid UI improvements

2018-05-10 Thread Jeff King
On Thu, May 10, 2018 at 12:42:57PM +, Ævar Arnfjörð Bjarmason wrote: > This is like v3 except all the patches to the peel syntax & docs have > been dropped, which were controversial. > > I think it's worthwhile to re-work that, but I don't have time for > that now, so I'm submitting this.

Re: [PATCH v2] add status config and command line options for rename detection

2018-05-10 Thread Elijah Newren
Hi Ben, On Thu, May 10, 2018 at 7:16 AM, Ben Peart wrote: > After performing a merge that has conflicts, git status will by default > attempt > to detect renames which causes many objects to be examined. In a virtualized > repo, those objects do not exist locally so

Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

2018-05-10 Thread Stefan Beller
Hi Junio, On Thu, May 10, 2018 at 2:27 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> So this would go with the latest sb/object-store-alloc ? >> >> My impression was that we never call repo_clear() on >> the_repository, which would allow us to

[PATCH 10/12] gc: automatically write commit-graph files

2018-05-10 Thread Derrick Stolee
The commit-graph file is a very helpful feature for speeding up git operations. In order to make it more useful, write the commit-graph file by default during standard garbage collection operations. Add a 'gc.commitGraph' config setting that triggers writing a commit-graph file after any

[PATCH 09/12] commit-graph: add '--reachable' option

2018-05-10 Thread Derrick Stolee
When writing commit-graph files, it can be convenient to ask for all reachable commits (starting at the ref set) in the resulting file. This is particularly helpful when writing to stdin is complicated, such as a future integration with 'git gc' which will call 'git commit-graph write --reachable'

[PATCH 05/12] commit: force commit to parse from object database

2018-05-10 Thread Derrick Stolee
In anticipation of verifying commit-graph file contents against the object database, create parse_commit_internal() to allow side-stepping the commit-graph file and parse directly from the object database. Most consumers expect that if a commit exists in the commit-graph, then the commit was

Re: [PATCH v2] pack-format.txt: more details on pack file format

2018-05-10 Thread Stefan Beller
On Thu, May 10, 2018 at 8:09 AM, Nguyễn Thái Ngọc Duy wrote: > The current document mentions OBJ_* constants without their actual > values. A git developer would know these are from cache.h but that's > not very friendly to a person who wants to read this file to implement > a

[PATCH 02/12] commit-graph: verify file header information

2018-05-10 Thread Derrick Stolee
During a run of 'git commit-graph verify', list the issues with the header information in the commit-graph file. Some of this information is inferred from the loaded 'struct commit_graph'. Some header information is checked as part of load_commit_graph_one(). Signed-off-by: Derrick Stolee

[PATCH 01/12] commit-graph: add 'verify' subcommand

2018-05-10 Thread Derrick Stolee
In case the commit-graph file becomes corrupt, we need a way to verify its contents match the object database. In the manner of 'git fsck' we will implement a 'git commit-graph verify' subcommand to report all issues with the file. Add the 'verify' subcommand to the 'commit-graph' builtin and its

[PATCH 00/12] Integrate commit-graph into fsck, gc, and fetch

2018-05-10 Thread Derrick Stolee
The commit-graph feature is not useful to end users until the commit-graph file is maintained automatically by Git during normal upkeep operations. One natural place to trigger this write is during 'git gc'. Before automatically generating a commit-graph, we need to be able to verify the contents

[PATCH 11/12] fetch: compute commit-graph by default

2018-05-10 Thread Derrick Stolee
During a call to 'git fetch', we expect new commits and updated refs. Use these updated refs to add the new commits to the commit-graph file, automatically providing performance benefits in other calls. Use 'fetch.commitGraph' config setting to enable or disable this behavior. Defaults to false

[PATCH 08/12] fsck: verify commit-graph

2018-05-10 Thread Derrick Stolee
If core.commitGraph is true, verify the contents of the commit-graph during 'git fsck' using the 'git commit-graph verify' subcommand. Run this check on all alternates, as well. We use a new process for two reasons: 1. The subcommand decouples the details of loading and verifying a

[PATCH 07/12] commit-graph: verify commit contents against odb

2018-05-10 Thread Derrick Stolee
When running 'git commit-graph verify', compare the contents of the commits that are loaded from the commit-graph file with commits that are loaded directly from the object database. This includes checking the root tree object ID, commit date, and parents. Parse the commit from the graph during

[PATCH 04/12] commit-graph: verify fanout and lookup table

2018-05-10 Thread Derrick Stolee
While running 'git commit-graph verify', verify that the object IDs are listed in lexicographic order and that the fanout table correctly navigates into that list of object IDs. Signed-off-by: Derrick Stolee --- commit-graph.c | 33 + 1

[PATCH 12/12] commit-graph: update design document

2018-05-10 Thread Derrick Stolee
The commit-graph feature is now integrated with 'fsck' and 'gc', so remove those items from the "Future Work" section of the commit-graph design document. Also remove the section on lazy-loading trees, as that was completed in an earlier patch series. Signed-off-by: Derrick Stolee

[PATCH 03/12] commit-graph: parse commit from chosen graph

2018-05-10 Thread Derrick Stolee
Before verifying a commit-graph file against the object database, we need to parse all commits from the given commit-graph file. Create parse_commit_in_graph_one() to target a given struct commit_graph. Signed-off-by: Derrick Stolee --- commit-graph.c | 18

[PATCH 06/12] commit-graph: load a root tree from specific graph

2018-05-10 Thread Derrick Stolee
When lazy-loading a tree for a commit, it will be important to select the tree from a specific struct commit_graph. Create a new method that specifies the commit-graph file and use that in get_commit_tree_in_graph(). Signed-off-by: Derrick Stolee --- commit-graph.c | 10

[PATCH v2] commit-graph: fix UX issue when .lock file exists

2018-05-10 Thread Derrick Stolee
We use the lockfile API to avoid multiple Git processes from writing to the commit-graph file in the .git/objects/info directory. In some cases, this directory may not exist, so we check for its existence. The existing code does the following when acquiring the lock: 1. Try to acquire the lock.

Re: [GSoC] Info: Week 02 Blog Post

2018-05-10 Thread Stefan Beller
Hi Pratik, On Wed, May 9, 2018 at 8:07 PM, Pratik Karki wrote: > Hi, > > The week 02 blog post[1] is live. This post is part I out of II and this > time it will be biweekly. The part II of will come in 2-3 days which > will describe the current `git-rebase.sh`. Cool

Re: [PATCH 1/2] object.c: free replace map in raw_object_store_clear

2018-05-10 Thread Stefan Beller
Hi Junio, On Thu, May 10, 2018 at 3:16 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> The replace map for objects was missed to free in the object store in >> the conversion of 174774cd519 (Merge branch 'sb/object-store-replace', >> 2018-05-08) > >

Re: [PATCH v4 00/13] object store: alloc

2018-05-10 Thread Jonathan Tan
On Wed, 9 May 2018 17:40:11 -0700 Stefan Beller wrote: > if (obj->type == OBJ_TREE) > - release_tree_node((struct tree*)obj); > + free_tree_buffer((struct tree*)obj); > else if (obj->type == OBJ_COMMIT) > -

Re: [PATCH 1/9] Add and use generic name->id mapping code for color slot parsing

2018-05-10 Thread Stefan Beller
On Thu, May 10, 2018 at 7:19 AM, Nguyễn Thái Ngọc Duy wrote: > 7 files changed, 82 insertions(+), 112 deletions(-) Nice! > > +static const char *color_branch_slots[] = { > + [BRANCH_COLOR_RESET]= "reset", In 512f41cfac5 (clean.c: use designated initializer,

  1   2   >