Re: [PATCH 1/5] chainlint: match arbitrary here-docs tags rather than hard-coded names

2018-08-08 Thread Eric Sunshine
On Wed, Aug 8, 2018 at 6:50 PM Jeff King wrote: > On Tue, Aug 07, 2018 at 04:21:31AM -0400, Eric Sunshine wrote: > > +# Swallowing here-docs with arbitrary tags requires a bit of finesse. When > > a > > +# line such as "cat > front > > +# of the

Re: Help with "fatal: unable to read ...." error during GC?

2018-08-08 Thread Paul Smith
On Wed, 2018-08-08 at 14:24 -0400, Jeff King wrote: > If so, can you try running it under gdb and getting a stack trace? > Something like: > > gdb git > [and then inside gdb...] > set args pack-objects --all --reflog --indexed-objects foobreak die > run > bt > > That might give us

Re: [PATCH 1/1] verify-tag/verify-commit should exit unsuccessfully when signature is not trusted

2018-08-08 Thread brian m. carlson
On Wed, Aug 08, 2018 at 05:59:43PM -0700, Junio C Hamano wrote: > "brian m. carlson" writes: > > >> FWIW, I'm on board with returning non-zero in any case where gpg would. > > > > I think that's probably the best solution overall. > > FWIW, I am not married to the current behaviour. I would

Re: [PATCH 1/1] verify-tag/verify-commit should exit unsuccessfully when signature is not trusted

2018-08-08 Thread Junio C Hamano
"brian m. carlson" writes: >> FWIW, I'm on board with returning non-zero in any case where gpg would. > > I think that's probably the best solution overall. FWIW, I am not married to the current behaviour. I would not be surprised if it mostly came by accident and not designed. > There's a

Re: [PATCH 1/2] submodule: create helper to build paths to submodule gitdirs

2018-08-08 Thread Brandon Williams
On 08/08, Stefan Beller wrote: > On Wed, Aug 8, 2018 at 3:33 PM Brandon Williams wrote: > > > > Introduce a helper function "submodule_name_to_gitdir()" (and the > > submodule--helper subcommand "gitdir") which constructs a path to a > > submodule's gitdir, located in the provided repository's

Re: [PATCH 0/5] chainlint: improve robustness against "unusual" shell coding

2018-08-08 Thread Junio C Hamano
Jeff King writes: > I had two minor comments on the first patch. I'll admit my eyes glazed > over looking at the rest of them, and to make any kind of intelligent > review I'd need to spend an hour understanding how the sed script works. > Which frankly, I'm not sure is worth it. Didn't I make

Re: [PATCH v2] clone: report duplicate entries on case-insensitive filesystems

2018-08-08 Thread Junio C Hamano
Jeff King writes: > I think we really want to avoid doing that normalization ourselves if we > can. There are just too many filesystem-specific rules. Exactly; not having to learn these rules is the major (if not whole) point of the "let checkout notice the collision and then deal with it"

Re: [RFC PATCH] packfile: iterate packed objects in pack order

2018-08-08 Thread Jeff King
On Wed, Aug 08, 2018 at 04:12:10PM -0700, Jonathan Tan wrote: > Many invocations of for_each_object_in_pack() and > for_each_packed_object() (which invokes the former) subsequently check > at least the type of the packed object, necessitating accessing the > packfile itself. For locality reasons,

Re: [PATCH 1/2] submodule: create helper to build paths to submodule gitdirs

2018-08-08 Thread Stefan Beller
On Wed, Aug 8, 2018 at 3:33 PM Brandon Williams wrote: > > Introduce a helper function "submodule_name_to_gitdir()" (and the > submodule--helper subcommand "gitdir") which constructs a path to a > submodule's gitdir, located in the provided repository's "modules" > directory. Makes sense. > >

Re: abstracting commit signing/verify to support other signing schemes

2018-08-08 Thread Jeff King
On Mon, Aug 06, 2018 at 08:24:25PM +, Tacitus Aedifex wrote: > the older patch set suggested the idea of using PEM strings to match up the > signature payload with a certain signing tool. i can't tell if they mean > the 'pre-ecapsulation boundary' (e.g. '-BEGIN FOO-') or if they mean

Re: [PATCH 1/1] verify-tag/verify-commit should exit unsuccessfully when signature is not trusted

2018-08-08 Thread brian m. carlson
On Wed, Aug 08, 2018 at 07:04:56PM -0400, Jeff King wrote: > On Sat, Aug 04, 2018 at 10:43:46AM +0200, Karel Kočí wrote: > > I have a solution for my problem (calling git verify-* twice and grep). > > That is > > not the point of this email nor this contribution. The point is that > > although >

[RFC PATCH] packfile: iterate packed objects in pack order

2018-08-08 Thread Jonathan Tan
Many invocations of for_each_object_in_pack() and for_each_packed_object() (which invokes the former) subsequently check at least the type of the packed object, necessitating accessing the packfile itself. For locality reasons, it is thus better to iterate in pack order, instead of index order.

Re: [PATCH 1/1] verify-tag/verify-commit should exit unsuccessfully when signature is not trusted

2018-08-08 Thread Jeff King
On Sat, Aug 04, 2018 at 10:43:46AM +0200, Karel Kočí wrote: > > I think the only sensible thing is to err on the conservative side, and > > return non-zero if we saw _any_ invalid signature. > > > > I will note, though, that just checking the exit code of `verify-tag` > > isn't really that

Re: [PATCH 0/5] chainlint: improve robustness against "unusual" shell coding

2018-08-08 Thread Jeff King
On Tue, Aug 07, 2018 at 04:21:30AM -0400, Eric Sunshine wrote: > This series improves chainlint's robustness when faced with the sort of > unusual shell coding in contrib/subtree/t7900 which triggered a > false-positive, as reported by Jonathan[1]. Jonathan has already > rewritten[2] that code to

Re: [PATCH 1/5] chainlint: match arbitrary here-docs tags rather than hard-coded names

2018-08-08 Thread Jeff King
On Tue, Aug 07, 2018 at 04:21:31AM -0400, Eric Sunshine wrote: > diff --git a/t/chainlint.sed b/t/chainlint.sed > index 5f0882cb38..bd76c5d181 100644 > --- a/t/chainlint.sed > +++ b/t/chainlint.sed > @@ -61,6 +61,22 @@ > # "else", and "fi" in if-then-else likewise must not end with "&&", thus >

Re: [PATCH] update-index: there no longer is `apply --index-info`

2018-08-08 Thread Jeff King
On Wed, Aug 08, 2018 at 02:35:18PM -0700, Junio C Hamano wrote: > Back when we removed `git apply --index-info` in 2007, we forgot to > adjust the documentation for update-index that reads its output. > > Let's reorder the description of three formats to present the other > two formats that are

Re: What's cooking in git.git (Aug 2018, #02; Mon, 6)

2018-08-08 Thread Junio C Hamano
Junio C Hamano writes: > Hmph, it came from this message (most headers omitted) > > To: =?iso-8859-1?Q?=C6var_Arnfj=F6r=F0?= Bjarmason > Message-ID: <20180804085247.ge55...@aiede.svl.corp.google.com> > Content-Type: text/plain; charset=iso-8859-1 > Content-Disposition:

[PATCH v2 1/2] repack: refactor setup of pack-objects cmd

2018-08-08 Thread Jonathan Tan
A subsequent patch will teach repack to run pack-objects with some same and some different arguments if repacking of promisor objects is required. Refactor the setup of the pack-objects cmd so that setting up the arguments common to both is done in a function. Signed-off-by: Jonathan Tan ---

[PATCH v2 0/2] Repacking of promisor packfiles

2018-08-08 Thread Jonathan Tan
Changes from v1: - add NEEDSWORK stating that input to pack-objects could be removed - run pack-objects to repack promisor objects only if there is at least one of them - this exposed a possible bug where the later part of cmd_repack() requires a correct packed_git (this was mostly noticed

[PATCH v2 2/2] repack: repack promisor objects if -a or -A is set

2018-08-08 Thread Jonathan Tan
Currently, repack does not touch promisor packfiles at all, potentially causing the performance of repositories that have many such packfiles to drop. Therefore, repack all promisor objects if invoked with -a or -A. This is done by an additional invocation of pack-objects on all promisor objects

[PATCH 2/2] submodule: munge paths to submodule git directories

2018-08-08 Thread Brandon Williams
Commit 0383bbb901 (submodule-config: verify submodule names as paths, 2018-04-30) introduced some checks to ensure that submodule names don't include directory traversal components (e.g. "../"). This addresses the vulnerability identified in 0383bbb901 but the root cause is that we use submodule

[PATCH 1/2] submodule: create helper to build paths to submodule gitdirs

2018-08-08 Thread Brandon Williams
Introduce a helper function "submodule_name_to_gitdir()" (and the submodule--helper subcommand "gitdir") which constructs a path to a submodule's gitdir, located in the provided repository's "modules" directory. This consolidates the logic needed to build up a path into a repository's "modules"

[PATCH 0/2] munge submodule names

2018-08-08 Thread Brandon Williams
Here's a more polished series taking into account some of the feedback on the RFC. As Junio pointed out URL encoding makes the directories much more human readable, but I'm open to other ideas if we don't think URL encoding is the right thing to do. Brandon Williams (2): submodule: create

Re: [PATCH v2] clone: report duplicate entries on case-insensitive filesystems

2018-08-08 Thread Jeff King
On Wed, Aug 08, 2018 at 03:48:04PM -0400, Jeff Hostetler wrote: > > ce_match_stat() may not be a very good measure to see if two paths > > refer to the same file, though. After a fresh checkout, I would not > > be surprised if two completely unrelated paths have the same size > > and have same

Re: [PATCH 1/1] pull --rebase=: allow single-letter abbreviations for the type

2018-08-08 Thread Junio C Hamano
Junio C Hamano writes: > Ævar Arnfjörð Bjarmason writes: > >>> - else if (!strcmp(value, "preserve")) >>> + else if (!strcmp(value, "preserve") || !strcmp(value, "p")) >>> return REBASE_PRESERVE; >>> - else if (!strcmp(value, "merges")) >>> + else if (!strcmp(value,

[PATCH 10/10] fetch: retry fetching submodules if sha1 were not fetched

2018-08-08 Thread Stefan Beller
Currently when git-fetch is asked to recurse into submodules, it dispatches a plain "git-fetch -C " (and some submodule related options such as prefix and recusing strategy, but) without any information of the remote or the tip that should be fetched. This works surprisingly well in some

[PATCH 09/10] submodule: fetch in submodules git directory instead of in worktree

2018-08-08 Thread Stefan Beller
This patch started as a refactoring to make 'get_next_submodule' more readable, but upon doing so, I realized that git-fetch actually doesn't need to be run in the worktree. So let's run it in the git dir instead. That should pave the way towards fetching submodules that are currently not checked

[PATCH 07/10] submodule: move global changed_submodule_names into fetch submodule struct

2018-08-08 Thread Stefan Beller
The `changed_submodule_names` are only used for fetching, so let's make it part of the struct that is passed around for fetching submodules. Signed-off-by: Stefan Beller --- submodule.c | 42 +++--- 1 file changed, 23 insertions(+), 19 deletions(-) diff

[PATCH 08/10] submodule.c: do not copy around submodule list

2018-08-08 Thread Stefan Beller
'calculate_changed_submodule_paths' uses a local list to compute the changed submodules, and then produces the result by copying appropriate items into the result list. Instead use the result list directly and prune items afterwards using string_list_remove_empty_items. As a side effect, we'll

[PATCH 05/10] submodule.c: fix indentation

2018-08-08 Thread Stefan Beller
The submodule subsystem is really bad at staying within 80 characters. Fix it while we are here. Signed-off-by: Stefan Beller --- submodule.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/submodule.c b/submodule.c index 5b4e5227d90..bceeba13217 100644 ---

[PATCH 04/10] submodule.c: convert submodule_move_head new argument to object id

2018-08-08 Thread Stefan Beller
All callers use oid_to_hex to convert the desired oid to a string before calling submodule_move_head. Defer the conversion to the submodule_move_head as it will turn out to be useful in a bit. Signed-off-by: Stefan Beller --- entry.c| 6 +++--- submodule.c| 12 ++--

[PATCH 03/10] sha1-array: provide oid_array_remove_if

2018-08-08 Thread Stefan Beller
Signed-off-by: Stefan Beller --- sha1-array.c | 39 +++ sha1-array.h | 3 +++ 2 files changed, 42 insertions(+) diff --git a/sha1-array.c b/sha1-array.c index 265941fbf40..10eb08b425e 100644 --- a/sha1-array.c +++ b/sha1-array.c @@ -77,3 +77,42 @@ int

[PATCH 06/10] submodule.c: sort changed_submodule_names before searching it

2018-08-08 Thread Stefan Beller
Instead of sorting it after we created an unsorted list, we could insert correctly into the list. As the unsorted append is in order of cache entry names, this is already sorted if names were equal to paths for submodules. As submodule names are often the same as their path, the input is sorted

[PATCH 01/10] string_list: print_string_list to use trace_printf

2018-08-08 Thread Stefan Beller
It is a debugging aid, so it should print to the debugging channel. Signed-off-by: Stefan Beller --- string-list.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/string-list.c b/string-list.c index 771c4550980..9f651bb4294 100644 --- a/string-list.c +++ b/string-list.c

[PATCH 02/10] string-list.h: add string_list_pop function.

2018-08-08 Thread Stefan Beller
A string list can be used as a stack, but should we? A later patch shows how useful this will be. Signed-off-by: Stefan Beller --- string-list.c | 8 string-list.h | 6 ++ 2 files changed, 14 insertions(+) diff --git a/string-list.c b/string-list.c index 9f651bb4294..ea80afc8a0c

[RFC PATCH 00/10] fetch: make sure submodule oids are fetched

2018-08-08 Thread Stefan Beller
Currently when git-fetch is asked to recurse into submodules, it dispatches a plain "git-fetch -C " (and some submodule related options such as prefix and recusing strategy, but) without any information of the remote or the tip that should be fetched. This works surprisingly well in some

Re: Help with "fatal: unable to read ...." error during GC?

2018-08-08 Thread Paul Smith
On Wed, 2018-08-08 at 14:24 -0400, Jeff King wrote: > Let's narrow it down first and make sure we're dying where I expect. > Can > you try: > > GIT_TRACE=1 git gc > > and confirm the program running when the fatal error is produced? > > From what you've shown it's going to be git-repack, but

[PATCH] update-index: there no longer is `apply --index-info`

2018-08-08 Thread Junio C Hamano
Back when we removed `git apply --index-info` in 2007, we forgot to adjust the documentation for update-index that reads its output. Let's reorder the description of three formats to present the other two formats that are still generated by git commands before this format, and stop mentioning

Re: [PATCH] git-update-index.txt: reword possibly confusing example

2018-08-08 Thread Junio C Hamano
Elijah Newren writes: > The following phrase could be interpreted multiple ways: > "To pretend you have a file with mode and sha1 at path" > > In particular, I can think of two: > 1. Pretend we have some new file, which happens to have a given mode > and sha1 > 2. Pretend one of the

Re: [PATCH v2 0/4] Speed up unpack_trees()

2018-08-08 Thread Ben Peart
On 8/1/2018 12:38 PM, Duy Nguyen wrote: On Tue, Jul 31, 2018 at 01:31:31PM -0400, Ben Peart wrote: On 7/31/2018 12:50 PM, Ben Peart wrote: On 7/31/2018 11:31 AM, Duy Nguyen wrote: In the performance game of whack-a-mole, that call to repair cache-tree is now looking quite

[PATCH] git-update-index.txt: reword possibly confusing example

2018-08-08 Thread Elijah Newren
The following phrase could be interpreted multiple ways: "To pretend you have a file with mode and sha1 at path" In particular, I can think of two: 1. Pretend we have some new file, which happens to have a given mode and sha1 2. Pretend one of the files we are already tracking has a

Re: [PATCH 0/3] Resending sb/config-write-fix

2018-08-08 Thread Junio C Hamano
Stefan Beller writes: > This is a resend of sb/config-write-fix, with a slightly > better commit message and a renamed variable. > > Thanks, > Stefan Thanks. Let's declare victory and mark it to be merged to 'next'.

Re: [GSoC][PATCH v7 05/26] stash: convert apply to builtin

2018-08-08 Thread Junio C Hamano
Paul-Sebastian Ungureanu writes: > 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

Re: [PATCH 1/1] pull --rebase=: allow single-letter abbreviations for the type

2018-08-08 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: >> -else if (!strcmp(value, "preserve")) >> +else if (!strcmp(value, "preserve") || !strcmp(value, "p")) >> return REBASE_PRESERVE; >> -else if (!strcmp(value, "merges")) >> +else if (!strcmp(value, "merges") || !strcmp(value, "m")) >>

[PATCH 2/3] config: fix case sensitive subsection names on writing

2018-08-08 Thread Stefan Beller
A user reported a submodule issue regarding a section mix-up, but it could be boiled down to the following test case: $ git init test && cd test $ git config foo."Bar".key test $ git config foo."bar".key test $ tail -n 3 .git/config [foo "Bar"] key = test key = test

[PATCH 1/3] t1300: document current behavior of setting options

2018-08-08 Thread Stefan Beller
This documents current behavior of the config machinery, when changing the value of some settings. This patch just serves to provide a baseline for the follow up that will fix some issues with the current behavior. Signed-off-by: Stefan Beller --- t/t1300-config.sh | 86

[PATCH 3/3] git-config: document accidental multi-line setting in deprecated syntax

2018-08-08 Thread Stefan Beller
The bug was noticed when writing the previous patch; a fix for this bug is not easy though: If we choose to ignore the case of the subsection (and revert most of the code of the previous patch, just keeping s/strncasecmp/strcmp/), then we'd introduce new sections using the new syntax, such that

[PATCH 0/3] Resending sb/config-write-fix

2018-08-08 Thread Stefan Beller
This is a resend of sb/config-write-fix, with a slightly better commit message and a renamed variable. Thanks, Stefan Stefan Beller (3): t1300: document current behavior of setting options config: fix case sensitive subsection names on writing git-config: document accidental multi-line

Re: [PATCH v2] clone: report duplicate entries on case-insensitive filesystems

2018-08-08 Thread Jeff Hostetler
On 8/7/2018 3:31 PM, Junio C Hamano wrote: Nguyễn Thái Ngọc Duy writes: One nice thing about this is we don't need platform specific code for detecting the duplicate entries. I think ce_match_stat() works even on Windows. And it's now equally expensive on all platforms :D

Re: [PATCH 04/11] builtin rebase: support --quiet

2018-08-08 Thread Junio C Hamano
Stefan Beller writes: > On Wed, Aug 8, 2018 at 6:51 AM Pratik Karki wrote: >> >> This commit introduces a rebase option `--quiet`. While `--quiet` is >> commonly perceived as opposite to `--verbose`, this is not the case for >> the rebase command: both `--quiet` and `--verbose` default to

Re: [PATCH 03/11] builtin rebase: handle the pre-rebase hook (and add --no-verify)

2018-08-08 Thread Junio C Hamano
Pratik Karki writes: > This commit converts the equivalent part of the shell script > `git-legacy-rebase.sh` to run the pre-rebase hook (unless disabled), and > to interrupt the rebase with error if the hook fails. > > Signed-off-by: Pratik Karki > --- Introduction of upstream_arg in this step

Re: [PATCH 02/11] builtin rebase: support `git rebase --onto A...B`

2018-08-08 Thread Junio C Hamano
Pratik Karki writes: > This commit implements support for an --onto argument that is actually a > "symmetric range" i.e. `...`. > > The equivalent shell script version of the code offers two different > error messages for the cases where there is no merge base vs more than > one merge base.

Re: [PATCH 01/11] builtin rebase: support --onto

2018-08-08 Thread Junio C Hamano
Pratik Karki writes: > The `--onto` option is important, as it allows to rebase a range of > commits onto a different base commit (which gave the command its odd > name: "rebase"). Is there anything unimportant? A rhetorical question, of course. The quite casual and natural use of "to rebase"

Re: Page content is wider than view window

2018-08-08 Thread Brady Trainor
Jeff King writes: > Yes, there's work happening already for a visual refresh of the site, > [...] > > -Peff Awesome! Looking forward to it! -- Brady

[GSoC][PATCH v7 11/26] stash: change `git stash show` usage text and documentation

2018-08-08 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

[GSoC][PATCH v7 07/26] stash: convert branch to builtin

2018-08-08 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

[GSoC][PATCH v7 03/26] stash: update test cases conform to coding guidelines

2018-08-08 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

[GSoC][PATCH v7 17/26] stash: avoid spawning a "diff-index" process

2018-08-08 Thread Paul-Sebastian Ungureanu
This commits replaces spawning `diff-index` child process by using the already existing `diff` API --- builtin/stash--helper.c | 56 ++--- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c index

[GSoC][PATCH v7 15/26] stash: convert create to builtin

2018-08-08 Thread Paul-Sebastian Ungureanu
Add stash create to the helper. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 406 git-stash.sh| 2 +- 2 files changed, 407 insertions(+), 1 deletion(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c

[GSoC][PATCH v7 26/26] stash: replace all "git apply" child processes with API calls

2018-08-08 Thread Paul-Sebastian Ungureanu
`apply_all_patches()` does not provide a method to apply patches from strbuf. Because of this, this commit introduces a new function `apply_patch_from_buf()` which applies a patch from buf. It works by saving the strbuf as a file. This way we can call `apply_all_patches()`. Before returning, the

Re: [PATCH 09/11] builtin rebase: start a new rebase only if none is in progress

2018-08-08 Thread Stefan Beller
On Wed, Aug 8, 2018 at 6:51 AM Pratik Karki wrote: > > To run a new rebase, there needs to be a check to assure that no other > rebase is in progress. New rebase operation cannot start until an > ongoing rebase operation completes or is terminated. > > Signed-off-by: Pratik Karki > --- >

[GSoC][PATCH v7 04/26] stash: renamed test cases to be more descriptive

2018-08-08 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

[GSoC][PATCH v7 12/26] stash: refactor `show_stash()` to use the diff API

2018-08-08 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

[GSoC][PATCH v7 18/26] stash: convert push to builtin

2018-08-08 Thread Paul-Sebastian Ungureanu
Add stash push to the helper. --- builtin/stash--helper.c | 209 git-stash.sh| 6 +- 2 files changed, 213 insertions(+), 2 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c index f905d3908..c26cad3d5 100644 ---

[GSoC][PATCH v7 06/26] stash: convert drop and clear to builtin

2018-08-08 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

[GSoC][PATCH v7 01/26] sha1-name.c: added 'get_oidf', which acts like 'get_oid'

2018-08-08 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

[GSoC][PATCH v7 13/26] stash: update `git stash show` documentation

2018-08-08 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 |

[GSoC][PATCH v7 23/26] stash: convert `stash--helper.c` into `stash.c`

2018-08-08 Thread Paul-Sebastian Ungureanu
The old shell script `git-stash.sh` was removed and replaced entirely by `builtin/stash.c`. In order to do that, `create` and `push` were adapted to work without `stash.sh`. For example, before this commit, `git stash create` called `git stash--helper create --message "$*"`. If it called `git

[GSoC][PATCH v7 00/26] Convert "git stash" to C builtin

2018-08-08 Thread Paul-Sebastian Ungureanu
Hello, Here is the whole `git stash` C version. Some of the previous patches were already reviewed (up to and including "stash: convert store to builtin"), but there are some which were not (starting with "stash: convert create to builtin"). In order to see the difference between the shell

[GSoC][PATCH v7 05/26] stash: convert apply to builtin

2018-08-08 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

[GSoC][PATCH v7 09/26] stash: implement the "list" command in the builtin

2018-08-08 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 | 31 +++ git-stash.sh| 7 +-- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git

[GSoC][PATCH v7 10/26] stash: convert show to builtin

2018-08-08 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`

[GSoC][PATCH v7 08/26] stash: convert pop to builtin

2018-08-08 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

[GSoC][PATCH v7 24/26] stash: optimize `get_untracked_files()` and `check_changes()`

2018-08-08 Thread Paul-Sebastian Ungureanu
This commits introduces a optimization by avoiding calling the same functions again. For example, `git stash push -u` would call at some points the following functions: * `check_changes()` * `do_create_stash()`, which calls: `check_changes()` and `get_untracked_files()` Note that

[GSoC][PATCH v7 19/26] stash: make push to be quiet

2018-08-08 Thread Paul-Sebastian Ungureanu
There is a change in behaviour with this commit. When there was no initial commit, the shell version of stash would still display a message. This commit makes `push` to not display any message if `--quiet` or `-q` is specified. --- builtin/stash--helper.c | 41

[GSoC][PATCH v7 20/26] stash: add tests for `git stash push -q`

2018-08-08 Thread Paul-Sebastian Ungureanu
This commit introduces more tests for the quiet option of `git stash push`. --- t/t3903-stash.sh | 21 + 1 file changed, 21 insertions(+) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 8d002a7f2..b78db74ae 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@

[GSoC][PATCH v7 22/26] stash: convert save to builtin

2018-08-08 Thread Paul-Sebastian Ungureanu
Add stash save to the helper and delete functions which are no longer needed (`show_help()`, `save_stash()`, `push_stash()`, `create_stash()`, `clear_stash()`, `untracked_files()` and `no_changes()`). --- builtin/stash--helper.c | 48 +++ git-stash.sh| 311

[GSoC][PATCH v7 14/26] stash: convert store to builtin

2018-08-08 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 | 52 + git-stash.sh|

[GSoC][PATCH v7 25/26] stash: replace all `write-tree` child processes with API calls

2018-08-08 Thread Paul-Sebastian Ungureanu
This commit replaces spawning `git write-tree` with API calls. --- builtin/stash.c | 40 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/builtin/stash.c b/builtin/stash.c index 4d5c0d16e..46e76a34e 100644 --- a/builtin/stash.c +++

[GSoC][PATCH v7 16/26] stash: replace spawning a "read-tree" process

2018-08-08 Thread Paul-Sebastian Ungureanu
Instead of spawning a child process, make use of `reset_tree()` function already implemented in `stash-helper.c`. --- builtin/stash--helper.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c index a4e57899b..887b78d05

[GSoC][PATCH v7 21/26] stash: replace spawning `git ls-files` child process

2018-08-08 Thread Paul-Sebastian Ungureanu
This commit replaces spawning `git ls-files` child process with API calls to get the untracked files. --- builtin/stash--helper.c | 49 +++-- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c index

[GSoC][PATCH v7 02/26] stash: improve option parsing test coverage

2018-08-08 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 ---

Re: [PATCH 11/11] builtin rebase: support `git rebase `

2018-08-08 Thread Johannes Schindelin
Hi Duy, On Wed, 8 Aug 2018, Duy Nguyen wrote: > On Wed, Aug 8, 2018 at 3:55 PM Pratik Karki wrote: > > > > diff --git a/builtin/rebase.c b/builtin/rebase.c > > index 63634210c0..b2ddfa8dbf 100644 > > --- a/builtin/rebase.c > > +++ b/builtin/rebase.c > > @@ -585,7 +602,8 @@ int cmd_rebase(int

Re: [PATCH 08/11] builtin rebase: support --force-rebase

2018-08-08 Thread Stefan Beller
On Wed, Aug 8, 2018 at 6:51 AM Pratik Karki wrote: > @@ -551,10 +560,21 @@ int cmd_rebase(int argc, const char **argv, const char > *prefix) [...] > ; /* be quiet */ > else if (!strcmp(branch_name, "HEAD") && > -

Re: [PATCH v2 4/4] unpack-trees: cheaper index update when walking by cache-tree

2018-08-08 Thread Elijah Newren
On Sun, Jul 29, 2018 at 3:36 AM Nguyễn Thái Ngọc Duy wrote: > > With the new cache-tree, we could mostly avoid I/O (due to odb access) > the code mostly becomes a loop of "check this, check that, add the > entry to the index". We could skip a couple checks in this giant loop > to go faster: > > -

Re: [PATCH 2/2] repack: repack promisor objects if -a or -A is set

2018-08-08 Thread Jonathan Tan
> But what to delta against what else is determined by the pathname > info, which is now lost by enumerating objects without tree/history > walking. By giving phoney pathnames to objects while enumerating > them in offset order and giving similar pathnames to objects closer > to each other, I was

Re: Page content is wider than view window

2018-08-08 Thread Brady Trainor
Eric Sunshine writes: > The git-scm.com website is maintained as a distinct project[1] at > Github; it is not directly related to the Git project itself (to which > you sent this email). A good way to voice a concern or make a > suggestion about the website is either to open an issue[2] or

Re: [PATCH v3 0/4] Speed up unpack_trees()

2018-08-08 Thread Junio C Hamano
Junio C Hamano writes: > Junio C Hamano writes: > >> not used behind is *not* OK. And lack of restoring the bottom in >> the new codepath makes me suspect exactly such a bug _after_ the >> traversal exits the subtree we are using this new optimization in >> and moves on. > > Hmph, thinking

Re: [PATCH 04/11] builtin rebase: support --quiet

2018-08-08 Thread Stefan Beller
On Wed, Aug 8, 2018 at 6:51 AM Pratik Karki wrote: > > This commit introduces a rebase option `--quiet`. While `--quiet` is > commonly perceived as opposite to `--verbose`, this is not the case for > the rebase command: both `--quiet` and `--verbose` default to `false` if > neither `--quiet` nor

Re: [PATCH v3 3/4] unpack-trees: reduce malloc in cache-tree walk

2018-08-08 Thread Elijah Newren
On Fri, Aug 3, 2018 at 10:39 PM Nguyễn Thái Ngọc Duy wrote: > > This is a micro optimization that probably only shines on repos with > deep directory structure. Instead of allocating and freeing a new > cache_entry in every iteration, we reuse the last one and only update > the parts that are new

Re: Help with "fatal: unable to read ...." error during GC?

2018-08-08 Thread Jeff King
On Wed, Aug 08, 2018 at 01:35:30PM -0400, Paul Smith wrote: > Thanks for the note! Unhappily for me none of these operations seem to > find any actionable problems... > [...] Drat. One other option is that it _could_ be related to the "old unreachable objects that are reachable from recent

Re: [PATCH v3 2/4] unpack-trees: optimize walking same trees with cache-tree

2018-08-08 Thread Elijah Newren
On Fri, Aug 3, 2018 at 10:39 PM Nguyễn Thái Ngọc Duy wrote: > From: Duy Nguyen > > In order to merge one or many trees with the index, unpack-trees code > walks multiple trees in parallel with the index and performs n-way > merge. If we find out at start of a directory that all trees are the >

Re: [PATCH v3 0/4] Speed up unpack_trees()

2018-08-08 Thread Junio C Hamano
Junio C Hamano writes: > not used behind is *not* OK. And lack of restoring the bottom in > the new codepath makes me suspect exactly such a bug _after_ the > traversal exits the subtree we are using this new optimization in > and moves on. Hmph, thinking about this further, I cannot convince

Re: Help with "fatal: unable to read ...." error during GC?

2018-08-08 Thread Paul Smith
On Wed, 2018-08-08 at 12:06 -0400, Jeff King wrote: > I'd have expected fsck to find it, too. However, looking at the code, > I'm not convinced that fsck is actually considering detached worktree > heads properly, either. Try: > > git rev-list --all --reflog --objects >/dev/null > > which I

Re: [PATCH v3 0/4] Speed up unpack_trees()

2018-08-08 Thread Junio C Hamano
Duy Nguyen writes: > On Mon, Aug 6, 2018 at 5:48 PM Junio C Hamano wrote: >> > I've also checked about the lookahead thing in unpack_trees() to see >> > if we accidentally break something there, which is my biggest worry. >> > See [1] and [2] for context, but I believe since we can't have D/F

Re: [PATCH v4 00/21] Add `range-diff`, a `tbdiff` lookalike

2018-08-08 Thread Stefan Beller
On Wed, Aug 8, 2018 at 6:05 AM Johannes Schindelin wrote: > > [...] > > > diff --git a/Makefile b/Makefile > > > --- a/Makefile > > > +++ b/Makefile > > > > The line starting with --- is red (default removed color) and the line > > with +++ is green (default add color). > > > >

Re: [PATCH v3 0/4] Speed up unpack_trees()

2018-08-08 Thread Ben Peart
On 8/6/2018 2:59 PM, Junio C Hamano wrote: Duy Nguyen writes: We require the unpacked entry from all input trees to be a tree objects (the dirmask thing), so if one tree has 't' as a file, Ah, OK, this is still part of that "all the trees match cache tree so we walk the index instead"

Re: [PATCH 2/2] remote-curl: remove spurious period

2018-08-08 Thread Elijah Newren
On Wed, Aug 8, 2018 at 4:52 AM Johannes Schindelin via GitGitGadget wrote: > > We should not interrupt. sentences in the middle. I love this. commit message. :-) ... > /* The client backend isn't giving us compressed data so > -* we can try to deflate it

Re: [PATCH 2/2] repack: repack promisor objects if -a or -A is set

2018-08-08 Thread Junio C Hamano
Jonathan Tan writes: >> Just a note (and a request-for-sanity-check) and not meant to be a >> request to update the code, but with a still-in-pu 4b757a40 ("Use >> remote_odb_get_direct() and has_remote_odb()", 2018-08-02) in >> flight, repository_format_partial_clone is now gone. >> ... > Thanks

[PATCHv4 0/5] Simple fixes to t7406

2018-08-08 Thread Elijah Newren
Changes since v3, all suggested/endorsed by Junio (range-diff at the end): - Moved the actual fix from being last patch in the series to the first (other patches in this series are just test code cleanups) - Anchored regexes to avoid matching another filename as a substring - Add

  1   2   >