[PATCH v2 10/24] multi-pack-index: write pack names in chunk

2018-06-25 Thread Derrick Stolee
The multi-pack-index needs to track which packfiles it indexes. Store these in our first required chunk. Since filenames are not well structured, add padding to keep good alignment in later chunks. Modify the 'git multi-pack-index read' subcommand to output the existence of the pack-file name

[PATCH v2 19/24] midx: use midx in abbreviation calculations

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- midx.c | 11 ++ midx.h | 3 ++ packfile.c | 6 packfile.h | 1 + sha1-name.c | 70 + t/t5319-multi-pack-index.sh | 3 +-

[PATCH v2 24/24] midx: clear midx on repack

2018-06-25 Thread Derrick Stolee
If a 'git repack' command replaces existing packfiles, then we must clear the existing multi-pack-index before moving the packfiles it references. Signed-off-by: Derrick Stolee --- builtin/repack.c | 8 midx.c | 8 midx.h | 1 + 3 files changed, 17

[PATCH v2 23/24] packfile: skip loading index if in multi-pack-index

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- packfile.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/packfile.c b/packfile.c index f2b8d6f8a7..acd02430a8 100644 --- a/packfile.c +++ b/packfile.c @@ -469,8 +469,19 @@ static int open_packed_git_1(struct packed_git

[PATCH v2 17/24] midx: prepare midxed_git struct

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- midx.c | 22 ++ midx.h | 3 +++ object-store.h | 9 + packfile.c | 6 +- 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/midx.c b/midx.c index 71ca493107..3dd5027dc6 100644 --- a/midx.c +++

[PATCH v2 22/24] midx: prevent duplicate packfile loads

2018-06-25 Thread Derrick Stolee
The multi-pack-index, when present, tracks the existence of objects and their offsets within a list of packfiles. This allows us to use the multi-pack-index for object lookups, abbreviations, and object counts. When the multi-pack-index tracks a packfile, then we do not need to add that packfile

[PATCH v2 20/24] midx: use existing midx when writing new one

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- midx.c | 107 ++--- midx.h | 1 + 2 files changed, 96 insertions(+), 12 deletions(-) diff --git a/midx.c b/midx.c index c258e3ebdf..02cbfc5bd5 100644 --- a/midx.c +++ b/midx.c @@ -47,7 +47,6 @@ struct

[PATCH v2 15/24] midx: write object offsets

2018-06-25 Thread Derrick Stolee
The final pair of chunks for the multi-pack-index file stores the object offsets. We default to using 32-bit offsets as in the pack-index version 1 format, but if there exists an offset larger than 32-bits, we use a trick similar to the pack-index version 2 format by storing all offsets at least

[PATCH v2 18/24] midx: read objects from multi-pack-index

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- midx.c | 93 -- midx.h | 2 ++ object-store.h | 1 + packfile.c | 8 - 4 files changed, 101 insertions(+), 3 deletions(-) diff --git a/midx.c b/midx.c index 3dd5027dc6..14514d6828 100644

[PATCH v2 07/24] multi-pack-index: expand test data

2018-06-25 Thread Derrick Stolee
As we build the multi-pack-index file format, we want to test the format on real repoasitories. Add tests to t5319-multi-pack-index.sh that create repository data including multiple packfiles with both version 1 and version 2 formats. The current 'git multi-pack-index write' command will always

[PATCH v2 21/24] midx: use midx in approximate_object_count

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- packfile.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packfile.c b/packfile.c index 20b743da91..e72e8a685d 100644 --- a/packfile.c +++ b/packfile.c @@ -863,11 +863,14 @@ unsigned long approximate_object_count(void) { if

Re: [PATCH v6 20/21] gc: automatically write commit-graph files

2018-06-25 Thread Derrick Stolee
On 6/8/2018 6:24 PM, SZEDER Gábor wrote: The commit-graph file is a very helpful feature for speeding up git operations. In order to make it more useful, make it possible to write the commit-graph file during standard garbage collection operations. Add a 'gc.commitGraph' config setting that

[PATCH v2 05/24] midx: write header information to lockfile

2018-06-25 Thread Derrick Stolee
As we begin writing the multi-pack-index format to disk, start with the basics: the 12-byte header and the 20-byte checksum footer. Start with these basics so we can add the rest of the format in small increments. As we implement the format, we will use a technique to check that our computed

[PATCH v2 00/24] Multi-pack-index (MIDX)

2018-06-25 Thread Derrick Stolee
From: Derrick Stolee This v2 patch has several significant changes from v1. Thanks for all the feedback that informed these changes: * The 'midx' builtin is renamed to 'multi-pack-index' * The 'core.midx' config setting is renamed to 'core.multiPackIndex' * Many die() or error() statements

[PATCH v2 03/24] multi-pack-index: add builtin

2018-06-25 Thread Derrick Stolee
This new 'git multi-pack-index' builtin will be the plumbing access for writing, reading, and checking multi-pack-index files. The initial implementation is a no-op. Signed-off-by: Derrick Stolee --- .gitignore | 3 +- Documentation/git-multi-pack-index.txt | 36

[PATCH v2 08/24] packfile: generalize pack directory list

2018-06-25 Thread Derrick Stolee
In anticipation of sharing the pack directory listing with the multi-pack-index, generalize prepare_packed_git_one() into for_each_file_in_pack_dir(). Signed-off-by: Derrick Stolee --- packfile.c | 103 + packfile.h | 6 2 files

[PATCH v2 13/24] midx: write object ids in a chunk

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- Documentation/technical/pack-format.txt | 4 ++ midx.c | 51 ++--- object-store.h | 1 + t/helper/test-read-midx.c | 2 + t/t5319-multi-pack-index.sh | 4

[PATCH v2 14/24] midx: write object id fanout chunk

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- Documentation/technical/pack-format.txt | 5 +++ midx.c | 53 +++-- object-store.h | 1 + t/helper/test-read-midx.c | 4 +- t/t5319-multi-pack-index.sh |

[PATCH v2 12/24] midx: sort and deduplicate objects from packfiles

2018-06-25 Thread Derrick Stolee
Before writing a list of objects and their offsets to a multi-pack-index, we need to collect the list of objects contained in the packfiles. There may be multiple copies of some objects, so this list must be deduplicated. It is possible to artificially get into a state where there are many

[PATCH v2 02/24] multi-pack-index: add format details

2018-06-25 Thread Derrick Stolee
The multi-pack-index feature generalizes the existing pack-index feature by indexing objects across multiple pack-files. Describe the basic file format, using a 12-byte header followed by a lookup table for a list of "chunks" which will be described later. The file ends with a footer containing a

[PATCH v2 09/24] multi-pack-index: read packfile list

2018-06-25 Thread Derrick Stolee
When constructing a multi-pack-index file for a given object directory, read the files within the enclosed pack directory and find matches that end with ".idx" and find the correct paired packfile using add_packed_git(). Signed-off-by: Derrick Stolee --- midx.c | 45

[PATCH v2 06/24] multi-pack-index: load into memory

2018-06-25 Thread Derrick Stolee
Create a new multi_pack_index struct for loading multi-pack-indexes into memory. Create a test-tool builtin for reading basic information about that multi-pack-index to verify the correct data is written. Signed-off-by: Derrick Stolee --- Makefile| 1 + midx.c

[PATCH v2 16/24] config: create core.multiPackIndex setting

2018-06-25 Thread Derrick Stolee
The core.multiPackIndex config setting controls the multi-pack- index (MIDX) feature. If false, the setting will disable all reads from the multi-pack-index file. Add comparison commands in t5319-multi-pack-index.sh to check typical Git behavior remains the same as the config setting is turned on

[PATCH v2 11/24] midx: read pack names into array

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- midx.c | 31 +++ object-store.h | 1 + t/helper/test-read-midx.c | 5 + t/t5319-multi-pack-index.sh | 7 ++- 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/midx.c b/midx.c

[PATCH v2 04/24] multi-pack-index: add 'write' verb

2018-06-25 Thread Derrick Stolee
In anticipation of writing multi-pack-indexes, add a 'git multi-pack-index write' subcommand and send the options to a write_midx_file() method. Also create a basic test file that tests the 'write' subcommand. Signed-off-by: Derrick Stolee --- Documentation/git-multi-pack-index.txt | 22

[PATCH v2 01/24] multi-pack-index: add design document

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- Documentation/technical/multi-pack-index.txt | 109 +++ 1 file changed, 109 insertions(+) create mode 100644 Documentation/technical/multi-pack-index.txt diff --git a/Documentation/technical/multi-pack-index.txt

[GSoC][PATCH v4 2/3] rebase -i: rewrite checkout_onto() in C

2018-06-25 Thread Alban Gruin
This rewrites checkout_onto() from shell to C. The new version is called detach_onto(), given its role. A new command (“detach-onto”) is added to rebase--helper.c, as well as a new flag, “verbose”, to avoid silencing the output of the checkout operation called by detach_onto(). The function

[GSoC][PATCH v4 1/3] sequencer: extract a function to silence a command, except if it fails

2018-06-25 Thread Alban Gruin
This extracts the part of run_git_commit() that redirects the stdout and stderr of a command to a strbuf, and prints it if the command fails, to a helper function: run_command_silent_on_success(). It is intended to replace output() from git-rebase.sh in the rewrite of setup_reflog_action() and

[GSoC][PATCH v4 0/3] rebase -i: rewrite reflog operations in C

2018-06-25 Thread Alban Gruin
This patch series rewrites the reflog operations from shell to C. This is part of the effort to rewrite interactive rebase in C. The first commit is dedicated to creating a function to silence a command, as the sequencer will do in several places with these patches. This branch is based on

[GSoC][PATCH v4 3/3] rebase -i: rewrite setup_reflog_action() in C

2018-06-25 Thread Alban Gruin
This rewrites (the misnamed) setup_reflog_action() from shell to C. The new version is called checkout_onto(). A new command is added to rebase--helper.c, “checkout-base”. The shell version is then stripped. As $GIT_REFLOG_ACTION is no longer set at the first call of checkout_onto(), a call to

Re: [PATCH] t3401: add directory rename testcases for rebase and am

2018-06-25 Thread Elijah Newren
On Wed, Jun 6, 2018 at 10:04 PM, Elijah Newren wrote: > Add a simple directory rename testcase, in conjunction with each of the > types of rebases: > git-rebase--interactive > git-rebase--am > git-rebase--merge > and also use the same testcase for > git am --3way > > This demonstrates an

[PATCH v6 3/4] stash: convert branch to builtin

2018-06-25 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add stash branch to the helper and delete the apply_to_branch function from the shell script. Checkout does not currently provide a function for checking out a branch as cmd_checkout does a large amount of sanity checks first that we require here. Signed-off-by: Joel

[PATCH v6 2/4] stash: convert drop and clear to builtin

2018-06-25 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add the drop and clear commands to the builtin helper. These two are each simple, but are being added together as they are quite related. We have to unfortunately keep the drop and clear functions in the shell script as functions are called with parameters internally that

[PATCH v6 4/4] stash: convert pop to builtin

2018-06-25 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add stash pop to the helper and delete the pop_stash, drop_stash, assert_stash_ref functions from the shell script now that they are no longer needed. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 36

[PATCH v6 1/4] stash: convert apply to builtin

2018-06-25 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add a builtin helper for performing stash commands. Converting all at once proved hard to review, so starting with just apply lets conversion get started without the other commands being finished. The helper is being implemented as a drop in replacement for stash so that

Re: [PATCH v3 2/8] upload-pack: implement ref-in-want

2018-06-25 Thread Jonathan Tan
> +wanted-refs section > + * This section is only included if the client has requested a > + ref using a 'want-ref' line and if a packfile section is also > + included in the response. > + > + * Always begins with the section header "wanted-refs" Add a period at the end to

Re: [PATCH v3 7/8] fetch-pack: put shallow info in output parameter

2018-06-25 Thread Jonathan Tan
> static void update_shallow(struct fetch_pack_args *args, > -struct ref **sought, int nr_sought, > +struct ref *refs, update_shallow() now takes in a linked list of refs instead of an array. I see that the translation of this function is

Re: [PATCH 2/2] i18n: bisect: mark two supplementary strings for translation

2018-06-25 Thread Raphael Hertzog
Hi, On Thu, 21 Jun 2018, Raphael Hertzog wrote: > On Thu, 21 Jun 2018, Duy Nguyen wrote: > > Nice. There's another string in bisect_common() that should also be > > translated: "revision walk setup failed". Maybe you can mark it too? > > Sure. A new version of the second patch is attached. I

Re: [PATCH 02/15] apply.c: stop using index compat macros

2018-06-25 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > apply.c | 34 +++--- > 1 file changed, 19 insertions(+), 15 deletions(-) Until all the codepaths that reach these callsites to index_* functions from cmd_main() are converted to pass

Re: Unexpected ignorecase=false behavior on Windows

2018-06-25 Thread Bryan Turner
On Mon, Jun 25, 2018 at 9:34 AM Junio C Hamano wrote: > > Bryan Turner writes: > > > Git on Windows is not designed to run with anything other than > > core.ignoreCase=true, and attempting to do so will cause unexpected > > behavior. > > Even though I fully agree with your conclusion that the

Re: [GSoC][PATCH v3 2/3] rebase -i: rewrite setup_reflog_action() in C

2018-06-25 Thread Junio C Hamano
Alban Gruin writes: > Hi Junio, > > Le 22/06/2018 à 18:27, Junio C Hamano a écrit : >> Alban Gruin writes: >> > This rewrites (the misnamed) setup_reflog_action() from shell to C. The >> > new version is called checkout_base_commit(). >> >> ;-) on the "misnamed" part. Indeed, setting up the

Re: [PATCH] submodule.c: report the submodule that an error occurs in

2018-06-25 Thread Junio C Hamano
SZEDER Gábor writes: >> When an error occurs in updating the working tree of a submodule in >> submodule_move_head, tell the user which submodule the error occurred in. >> >> The call to read-tree contains a super-prefix, such that the read-tree >> will correctly report any path related issues,

[PATCH v4 0/9] Document/fix/warn about rebase incompatibilities and inconsistencies

2018-06-25 Thread Elijah Newren
git-rebase has lots of options that are mutually incompatible. Even among aspects of its behavior that is common to all rebase types, it has a number of inconsistencies. This series tries to document, fix, and/or warn users about many of these. Changes since v3 (range-diff included at the end):

[PATCH v4 3/9] t3422: new testcases for checking when incompatible options passed

2018-06-25 Thread Elijah Newren
git rebase is split into three types: am, merge, and interactive. Various options imply different types, and which mode we are using determine which sub-script (git-rebase--$type) is executed to finish the work. Not all options work with all types, so add tests for combinations where we expect

[PATCH v4 2/9] git-rebase.sh: update help messages a bit

2018-06-25 Thread Elijah Newren
signoff is not specific to the am-backend. Also, re-order a few options to make like things (e.g. strategy and strategy-option) be near each other. Signed-off-by: Elijah Newren --- git-rebase.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-rebase.sh

[PATCH v4 6/9] directory-rename-detection.txt: technical docs on abilities and limitations

2018-06-25 Thread Elijah Newren
Signed-off-by: Elijah Newren --- .../technical/directory-rename-detection.txt | 92 +++ 1 file changed, 92 insertions(+) create mode 100644 Documentation/technical/directory-rename-detection.txt diff --git a/Documentation/technical/directory-rename-detection.txt

[PATCH v4 4/9] git-rebase: error out when incompatible options passed

2018-06-25 Thread Elijah Newren
git rebase has three different types: am, merge, and interactive, all of which are implemented in terms of separate scripts. am builds on git-am, merge builds on git-merge-recursive, and interactive builds on git-cherry-pick. We make use of features in those lower-level commands in the different

[PATCH v6 2/4] stash: improve option parsing test coverage

2018-06-25 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb In preparation for converting the stash command incrementally to a builtin command, this patch improves test coverage of the option parsing. Both for having too many parameters, or too few. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu ---

[PATCH v6 0/4] stash: add new tests and introduce a new helper function

2018-06-25 Thread Paul-Sebastian Ungureanu
Hello, This first series of patches does bring some changes and improvements to the test suite. One of the patches also introduces a new function `get_oidf()` which will be hepful for the incoming patches related to `git stash`. Thanks, Paul Joel Teichroeb (1): stash: improve option parsing

[PATCH v6 1/4] sha1-name.c: added 'get_oidf', which acts like 'get_oid'

2018-06-25 Thread Paul-Sebastian Ungureanu
Compared to 'get_oid', 'get_oidf' has as parameters a printf format string and the additional arguments. This will help simplify the code in subsequent commits. Original-idea-by: Johannes Schindelin Signed-off-by: Paul-Sebastian Ungureanu --- cache.h | 1 + sha1-name.c | 19

[PATCH v6 3/4] stash: update test cases conform to coding guidelines

2018-06-25 Thread Paul-Sebastian Ungureanu
Removed whitespaces after redirection operators. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 120 --- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index af7586d43..de6cab1fe

[PATCH v6 4/4] stash: renamed test cases to be more descriptive

2018-06-25 Thread Paul-Sebastian Ungureanu
Renamed some test cases' labels to be more descriptive and under 80 characters per line. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index de6cab1fe..8d002a7f2

[PATCH v4 5/9] git-rebase.txt: address confusion between --no-ff vs --force-rebase

2018-06-25 Thread Elijah Newren
rebase was taught the --force-rebase option in commit b2f82e05de ("Teach rebase to rebase even if upstream is up to date", 2009-02-13). This flag worked for the am and merge backends, but wasn't a valid option for the interactive backend. rebase was taught the --no-ff option for interactive

[RFC PATCH v4 9/9] git-rebase: make --allow-empty-message the default

2018-06-25 Thread Elijah Newren
rebase backends currently behave differently with empty commit messages, largely as a side-effect of the different underlying commands on which they are based. am-based rebases apply commits with an empty commit message without stopping or requiring the user to specify an extra flag. (It is

[PATCH v4 8/9] t3401: add directory rename testcases for rebase and am

2018-06-25 Thread Elijah Newren
Add a simple directory rename testcase, in conjunction with each of the types of rebases: git-rebase--interactive git-rebase--am git-rebase--merge and also use the same testcase for git am --3way This demonstrates a difference in behavior between the different rebase backends in regards

[PATCH v4 7/9] git-rebase.txt: document behavioral differences between modes

2018-06-25 Thread Elijah Newren
There are a variety of aspects that are common to all rebases regardless of which backend is in use; however, the behavior for these different aspects varies in ways that could surprise users. (In fact, it's not clear -- to me at least -- that these differences were even desirable or

[PATCH v4 1/9] git-rebase.txt: document incompatible options

2018-06-25 Thread Elijah Newren
git rebase has many options that only work with one of its three backends. It also has a few other pairs of incompatible options. Document these. Signed-off-by: Elijah Newren --- Documentation/git-rebase.txt | 85 1 file changed, 77 insertions(+), 8

Re: [RFC PATCH v5] Implement --first-parent for git rev-list --bisect

2018-06-25 Thread Junio C Hamano
Tiago Botelho writes: > +test_expect_success "--bisect-all --first-parent" ' > +cat >expect1 < +$(git rev-parse CC) (dist=2) > +$(git rev-parse EX) (dist=1) > +$(git rev-parse D) (dist=1) > +$(git rev-parse FX) (dist=0) > +EOF > + > +cat >expect2 < +$(git rev-parse CC) (dist=2) > +$(git

Re: [PATCH v3 4/8] fetch: refactor the population of peer ref OIDs

2018-06-25 Thread Jonathan Tan
> Populate peer ref OIDs in get_ref_map instead of do_fetch. Besides > tightening scopes of variables in the code, this also prepares for > get_ref_map being able to be called multiple times within do_fetch. get_ref_map() is only called in one place in builtin/fetch.c, and that place is in

Re: [BUG] A part of an edge from an octopus merge gets colored, even with --color=never

2018-06-25 Thread Jeff King
On Sat, Jun 23, 2018 at 05:45:19PM -0400, Noam Postavsky wrote: > On 20 May 2016 at 18:12, Noam Postavsky > wrote: My, this is a blast from the past. :) > Subject: [PATCH v1] log: Fix coloring of certain octupus merge shapes > > For octopus merges where the first parent edge immediately

Re: Unexpected ignorecase=false behavior on Windows

2018-06-25 Thread Junio C Hamano
Bryan Turner writes: > Git on Windows is not designed to run with anything other than > core.ignoreCase=true, and attempting to do so will cause unexpected > behavior. Even though I fully agree with your conclusion that the document must make it crystal clear that core.ignoreCase must be set to

[PATCH v6 5/6] stash: update `git stash show` documentation

2018-06-25 Thread Paul-Sebastian Ungureanu
Add in documentation about the change of behavior regarding the `--quiet` option, which was introduced in the last commit. (the `--quiet` option does not exit anymore with erorr if it is given an empty stash as argument) Signed-off-by: Paul-Sebastian Ungureanu --- Documentation/git-stash.txt |

[PATCH v6 3/6] stash: change `git stash show` usage text and documentation

2018-06-25 Thread Paul-Sebastian Ungureanu
It is already stated in documentation that it will accept any option known to `git diff`, but not in the usage text and some parts of the documentation. Signed-off-by: Paul-Sebastian Ungureanu --- Documentation/git-stash.txt | 4 ++-- builtin/stash--helper.c | 4 ++-- 2 files changed, 4

[PATCH v6 6/6] stash: convert store to builtin

2018-06-25 Thread Paul-Sebastian Ungureanu
Add stash store to the helper and delete the store_stash function from the shell script. Add the usage string which was forgotten in the shell script. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 48 + git-stash.sh|

[PATCH v6 2/6] stash: convert show to builtin

2018-06-25 Thread Paul-Sebastian Ungureanu
Add stash show to the helper and delete the show_stash, have_stash, assert_stash_like, is_stash_like and parse_flags_and_rev functions from the shell script now that they are no longer needed. Before this commit, `git stash show` would ignore `--index` and `--quiet` options. Now, `git stash show`

[PATCH v6 1/6] stash: implement the "list" command in the builtin

2018-06-25 Thread Paul-Sebastian Ungureanu
Add stash list to the helper and delete the list_stash function from the shell script. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 33 + git-stash.sh| 7 +-- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git

[PATCH v6 4/6] stash: refactor `show_stash()` to use the diff API

2018-06-25 Thread Paul-Sebastian Ungureanu
Currently, `show_stash()` uses `cmd_diff()` to generate the output. After this commit, the output will be generated using the internal API. Before this commit, `git stash show --quiet` would act like `git diff` and error out if the stash is not empty. Now, the `--quiet` option does not error out

Re: [BUG] url schemes should be case-insensitive

2018-06-25 Thread Junio C Hamano
Jeff King writes: > We seem to match url schemes case-sensitively: > > $ git clone SSH://example.com/repo.git > Cloning into 'repo'... > fatal: Unable to find remote helper for 'SSH' > > whereas rfc3986 is clear that the scheme portion is case-insensitive. > We probably ought to match at

[PATCH v4 1/8] test-pkt-line: add unpack-sideband subcommand

2018-06-25 Thread Brandon Williams
Add an 'unpack-sideband' subcommand to the test-pkt-line helper to enable unpacking packet line data sent multiplexed using a sideband. Signed-off-by: Brandon Williams --- t/helper/test-pkt-line.c | 33 + 1 file changed, 33 insertions(+) diff --git

[PATCH v4 2/8] upload-pack: implement ref-in-want

2018-06-25 Thread Brandon Williams
Currently, while performing packfile negotiation, clients are only allowed to specify their desired objects using object ids. This causes a vulnerability to failure when an object turns non-existent during negotiation, which may happen if, for example, the desired repository is provided by

[PATCH v4 6/8] fetch: refactor to make function args narrower

2018-06-25 Thread Brandon Williams
Refactor find_non_local_tags and get_ref_map to only take the information they need instead of the entire transport struct. Besides improving code clarity, this also improves their flexibility, allowing for a different set of refs to be used instead of relying on the ones stored in the transport

[PATCH v4 4/8] fetch: refactor the population of peer ref OIDs

2018-06-25 Thread Brandon Williams
Populate peer ref OIDs in get_ref_map instead of do_fetch. Besides tightening scopes of variables in the code, this also prepares for get_ref_map being able to be called multiple times within do_fetch. Signed-off-by: Brandon Williams --- builtin/fetch.c | 36 ++--

[PATCH v4 0/8] ref-in-want

2018-06-25 Thread Brandon Williams
Changes in v4 are fairly minor. There are a few documentation changes, commit message updates, as well as a few small style tweaks based on reviewer comments. Brandon Williams (8): test-pkt-line: add unpack-sideband subcommand upload-pack: implement ref-in-want upload-pack: test

[PATCH v4 5/8] fetch: refactor fetch_refs into two functions

2018-06-25 Thread Brandon Williams
Refactor the fetch_refs function into a function that does the fetching of refs and another function that stores them. This is in preparation for allowing additional processing of the fetched refs before updating the local ref store. Signed-off-by: Brandon Williams --- builtin/fetch.c | 23

Re: [PATCH v2 08/24] packfile: generalize pack directory list

2018-06-25 Thread Junio C Hamano
Derrick Stolee writes: > +struct prepare_pack_data > +{ ERROR: open brace '{' following struct go on the same line #88: FILE: packfile.c:777: +struct prepare_pack_data +{ > + struct repository *r; > + struct string_list *garbage; > + int local; > +}; > + > +static void

Re: [GSoC][PATCH v3 2/3] rebase -i: rewrite setup_reflog_action() in C

2018-06-25 Thread Johannes Schindelin
Hi, On Mon, 25 Jun 2018, Alban Gruin wrote: > Le 25/06/2018 à 17:34, Junio C Hamano a écrit : > > Alban Gruin writes: > > > >> Le 22/06/2018 à 18:27, Junio C Hamano a écrit : > >>> Alban Gruin writes: > This rewrites (the misnamed) setup_reflog_action() from shell to C. The > new

[PATCH 1/2] grep.c: extract show_line_header()

2018-06-25 Thread Taylor Blau
The grep code invokes show_line() to display the contents of a matched or context line in its output. Part of this execution is to print a line header that includes information such as the kind, the line- and column-number and etc. of that match. To prepare for the addition of an option to print

[PATCH 0/2] grep.c: teach --only-matching to 'git-grep(1)'

2018-06-25 Thread Taylor Blau
Hi, Attached is a resurrection of my previous topic [1] to add '--only-matching' (in the style of GNU grep) to 'git grep'. The changes are described in detail in each of the attached patches. Similar to the series to add --column to 'git grep', I have restarted this thread in order to not

[PATCH 2/2] grep.c: teach 'git grep --only-matching'

2018-06-25 Thread Taylor Blau
Teach 'git grep --only-matching', a new option to only print the matching part(s) of a line. For instance, a line containing the following (taken from README.md:27): (`man gitcvs-migration` or `git help cvs-migration` if git is Is printed as follows: $ git grep -no -e git -- README.md |

Re: [PATCH] filter-branch: skip commits present on --state-branch

2018-06-25 Thread Junio C Hamano
Michael Barabanov writes: > The commits in state:filter.map have already been processed, so don't > filter them again. This makes incremental git filter-branch much faster. > > Also add tests for --state-branch option. > > Signed-off-by: Michael Barabanov > --- > git-filter-branch.sh | 3

What's cooking in git.git (Jun 2018, #06; Mon, 25)

2018-06-25 Thread Junio C Hamano
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. Git 2.18 turned out to be an

Re: [PATCH v2 11/24] midx: read pack names into array

2018-06-25 Thread Eric Sunshine
On Mon, Jun 25, 2018 at 10:35 AM Derrick Stolee wrote: > diff --git a/midx.c b/midx.c > @@ -210,6 +227,20 @@ static void sort_packs_by_name(char **pack_names, > uint32_t nr_packs, uint32_t *p > +static size_t write_midx_pack_lookup(struct hashfile *f, > +char

Re: [PATCH v1 0/9] Introducing remote ODBs

2018-06-25 Thread Eric Sunshine
On Mon, Jun 25, 2018 at 5:49 PM Junio C Hamano wrote: > Christian Couder writes: > > This is a follow up from the patch series called "odb remote" [...] > > 5702.20 and 5702.21 seems to fail in standalone test, when these are > directly queued on top of Git v2.18.0; I haven't looked into the >

Re: [PATCH 4/5] commit-graph: store graph in struct object_store

2018-06-25 Thread Jonathan Tan
> I was looking at semantic merge conflicts between this and your > e2838d85 ("commit-graph: always load commit-graph information", > 2018-05-01), the latter of which I planned to merge to 'master' as a > part of the first batch in this cycle, and noticed that there are > two very similar

Re: [PATCH v4 0/8] ref-in-want

2018-06-25 Thread Jonathan Tan
> Changes in v4 are fairly minor. There are a few documentation changes, > commit message updates, as well as a few small style tweaks based on > reviewer comments. Patches 4 and 7, which I have commented on previously, look good. As for patch 2, it still has a missing period in the

Re: [PATCH v4 6/8] fetch: refactor to make function args narrower

2018-06-25 Thread Jonathan Tan
> Refactor find_non_local_tags and get_ref_map to only take the > information they need instead of the entire transport struct. Besides > improving code clarity, this also improves their flexibility, allowing > for a different set of refs to be used instead of relying on the ones > stored in the

Re: [PATCH v4 3/8] upload-pack: test negotiation with changing repository

2018-06-25 Thread Jonathan Tan
> --- /dev/null > +++ b/t/lib-httpd/one-time-sed.sh > @@ -0,0 +1,16 @@ > +#!/bin/sh > + > +if [ -e one-time-sed ]; then > + "$GIT_EXEC_PATH/git-http-backend" >out > + > + sed "$(cat one-time-sed)" out_modified > + > + if diff out out_modified >/dev/null; then > + cat out >

Re: [PATCH 0/2] Object store refactoring: make bitmap_git not global

2018-06-25 Thread Brandon Williams
On 06/07, Jonathan Tan wrote: > This is a continuation of the object store refactoring effort. > > We cannot truly free an object store without ensuring that any generated > bitmaps are first freed, so here are patches to drastically reduce the > lifetime of any bitmaps generated. As a bonus, the

Re: [PATCH] Makefile: tweak sed invocation

2018-06-25 Thread Eric Sunshine
On Mon, Jun 25, 2018 at 3:18 PM Alejandro R. Sedeño wrote: > With GNU sed, the r command doesn't care if a space separates it and > the filename it reads from. > > With SunOS sed, the space is required. MacOS and the various BSD's ship with BSD 'sed', not GNU 'sed', so it seemed prudent to check

Re: [PATCH 4/5] commit-graph: store graph in struct object_store

2018-06-25 Thread Junio C Hamano
Jonathan Tan writes: > Instead of storing commit graphs in static variables, store them in > struct object_store. There are no changes to the signatures of existing > functions - they all still only support the_repository, and support for > other instances of struct repository will be added in a

Re: [PATCH v3 8/8] fetch-pack: implement ref-in-want

2018-06-25 Thread Brandon Williams
On 06/22, Jonathan Nieder wrote: > Hi, > > Brandon Williams wrote: > > > Implement ref-in-want on the client side so that when a server supports > > the "ref-in-want" feature, a client will send "want-ref" lines for each > > reference the client wants to fetch. > > > > Signed-off-by: Brandon

Re: [PATCH v3 2/8] upload-pack: implement ref-in-want

2018-06-25 Thread Brandon Williams
On 06/25, Jonathan Tan wrote: > > +static int parse_want_ref(const char *line, struct string_list > > *wanted_refs) > > +{ > > + const char *arg; > > + if (skip_prefix(line, "want-ref ", )) { > > + struct object_id oid; > > + struct string_list_item *item; > > +

Re: [PATCH] Makefile: tweak sed invocation

2018-06-25 Thread Alejandro R . Sedeño
On 2018-06-25 16:15, Eric Sunshine wrote: On Mon, Jun 25, 2018 at 3:18 PM Alejandro R. Sedeño wrote: With GNU sed, the r command doesn't care if a space separates it and the filename it reads from. With SunOS sed, the space is required. MacOS and the various BSD's ship with BSD 'sed', not

Re: [PATCH v3 2/8] upload-pack: implement ref-in-want

2018-06-25 Thread Jonathan Tan
> +static int parse_want_ref(const char *line, struct string_list *wanted_refs) > +{ > + const char *arg; > + if (skip_prefix(line, "want-ref ", )) { > + struct object_id oid; > + struct string_list_item *item; > + struct object *o; > + > +

Re: [PATCH v3 7/8] fetch-pack: put shallow info in output parameter

2018-06-25 Thread Brandon Williams
On 06/25, Jonathan Tan wrote: > > static void update_shallow(struct fetch_pack_args *args, > > - struct ref **sought, int nr_sought, > > + struct ref *refs, > > update_shallow() now takes in a linked list of refs instead of an array. > I see that the

Re: [PATCH v3 0/7] grep.c: teach --column to 'git-grep(1)'

2018-06-25 Thread Jeff King
On Fri, Jun 22, 2018 at 10:49:26AM -0500, Taylor Blau wrote: > Attached is my third--anticipate the final--re-roll of my series to > teach 'git grep --column'. You know when you say that it jinxes it, right? :) > Since the last time, only a couple of things have changed at Peff's > suggestions

Re: [PATCH v2 03/24] multi-pack-index: add builtin

2018-06-25 Thread Junio C Hamano
Derrick Stolee writes: > This new 'git multi-pack-index' builtin will be the plumbing access > for writing, reading, and checking multi-pack-index files. The > initial implementation is a no-op. > > Signed-off-by: Derrick Stolee > --- > .gitignore | 3 +- >

Re: [PATCH v1 2/8] Add initial odb remote support

2018-06-25 Thread Junio C Hamano
Christian Couder writes: > For each promisor remote I think it makes no sense to have more than > one remote odb pointing to it. So I am not sure what to do here. If it makes no sense, then detecting and erroring out would be a sensible thing to do, no?

Re: [PATCH v2 07/24] multi-pack-index: expand test data

2018-06-25 Thread Junio C Hamano
Derrick Stolee writes: > test_expect_success 'write midx with no packs' ' > + test_when_finished rm pack/multi-pack-index && It is generally a good idea to give "-f" to "rm" used in test_when_finished. The main command sequence may have failed before it has a chance to create that file;

Re: [GSoC][PATCH v3 2/3] rebase -i: rewrite setup_reflog_action() in C

2018-06-25 Thread Alban Gruin
Hi Junio, Le 25/06/2018 à 17:34, Junio C Hamano a écrit : > Alban Gruin writes: > >> Hi Junio, >> >> Le 22/06/2018 à 18:27, Junio C Hamano a écrit : >>> Alban Gruin writes: This rewrites (the misnamed) setup_reflog_action() from shell to C. The new version is called

  1   2   >