[PATCH v4 4/8] mem-pool: tweak math on mp_block allocation size

2018-06-20 Thread Jameson Miller
The amount of memory to allocate for mp_blocks was off by a sizeof(uintmax_t) on platforms that do not support flexible arrays. To account for this, use the offset of the space field when calculating the total amount of memory to allocate for a mp_block. Signed-off-by: Jameson Miller ---

[PATCH v4 6/8] mem-pool: fill out functionality

2018-06-20 Thread Jameson Miller
Add functions for: - combining two memory pools - determining if a memory address is within the range managed by a memory pool These functions will be used by future commits. Signed-off-by: Jameson Miller --- mem-pool.c | 42 ++

[PATCH v4 7/8] block alloc: allocate cache entries from mem_pool

2018-06-20 Thread Jameson Miller
When reading large indexes from disk, a portion of the time is dominated in malloc() calls. This can be mitigated by allocating a large block of memory and manage it ourselves via memory pools. This change moves the cache entry allocation to be on top of memory pools. Design: The index_state

[PATCH v4 2/8] block alloc: add lifecycle APIs for cache_entry structs

2018-06-20 Thread Jameson Miller
Add an API around managing the lifetime of cache_entry structs. Abstracting memory management details behind this API will allow for alternative memory management strategies without affecting all the call sites. This commit does not change how memory is allocated or freed. A later commit in this

[PATCH v4 1/8] read-cache: teach refresh_cache_entry() to take istate

2018-06-20 Thread Jameson Miller
Refactor refresh_cache_entry() to work on a specific index, instead of implicitly using the_index. This is in preparation for making the make_cache_entry function apply to a specific index. Signed-off-by: Jameson Miller --- cache.h | 2 +- merge-recursive.c | 2 +- read-cache.c |

[PATCH v4 0/8] Allocate cache entries from mem_pool

2018-06-20 Thread Jameson Miller
Changes from V3: Mainly changes from last round of feedback: - Rename make_index_cache_entry -> make_cache_entry - Rename make_empty_index_cache_entry -> make_empty-cache_entry - Remove tail pointer in mem_pool - Small code tweaks - More accurately calculate mp_block size for

[PATCH v4 3/8] mem-pool: only search head block for available space

2018-06-20 Thread Jameson Miller
Instead of searching all memory blocks for available space to fulfill a memory request, only search the head block. If the head block does not have space, assume that previous block would most likely not be able to fulfill request either. This could potentially lead to more memory fragmentation,

[PATCH v4 5/8] mem-pool: add lifecycle management functions

2018-06-20 Thread Jameson Miller
Add initialization and discard functions to mem_pool type. As the memory allocated by mem_pool can now be freed, we also track the large memory alllocations so they can be freed as well. If the there are existing mp_blocks in the mem_pool's linked list of mp_blocks, then the mp_block for a large

[PATCH v4 8/8] block alloc: add validations around cache_entry lifecyle

2018-06-20 Thread Jameson Miller
Add an option (controlled by an environment variable) perform extra validations on mem_pool allocated cache entries. When set: 1) Invalidate cache_entry memory when discarding cache_entry. 2) When discarding index_state struct, verify that all cache_entries were allocated from expected

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

2018-06-20 Thread Brandon Williams
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 Williams --- fetch-pack.c | 35 +++---

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

2018-06-20 Thread Brandon Williams
Changes in v3: * Discussion seemed to settle on keeping the simplified version of ref-in-want where the "want-ref" line only accepts full ref names. If we want to we can add patterns at a later time. * Reverted back to v1's behavior where requesting a ref that doesn't exists is a hard error

Re: [RFC PATCH 03/10] t7411: be nicer to other tests and really clean things up

2018-06-20 Thread Antonio Ospite
On Mon, 14 May 2018 18:23:22 -0700 Stefan Beller wrote: > On Mon, May 14, 2018 at 3:58 AM, Antonio Ospite wrote: > > Tests 5 and 8 in t/t7411-submodule-config.sh add two commits with > > invalid lines in .gitmodules but then only the second commit is removed. > > > > This may affect subsequent

Re: [RFC PATCH 04/10] submodule--helper: add a new 'config' subcommand

2018-06-20 Thread Antonio Ospite
On Mon, 14 May 2018 18:33:44 -0700 Stefan Beller wrote: > On Mon, May 14, 2018 at 3:58 AM, Antonio Ospite wrote: > > Add a new 'config' subcommand to 'submodule--helper', this extra level > > of indirection makes it possible to add some flexibility to how the > > submodules configuration is

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

2018-06-20 Thread Brandon Williams
Add tests to check the behavior of fetching from a repository which changes between rounds of negotiation (for example, when different servers in a load-balancing agreement participate in the same stateless RPC negotiation). This forms a baseline of comparison to the ref-in-want functionality

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

2018-06-20 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 v3 4/8] fetch: refactor the population of peer ref OIDs

2018-06-20 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 v3 1/8] test-pkt-line: add unpack-sideband subcommand

2018-06-20 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 v3 6/8] fetch: refactor to make function args narrower

2018-06-20 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 v3 7/8] fetch-pack: put shallow info in output parameter

2018-06-20 Thread Brandon Williams
Expand the transport fetch method signature, by adding an output parameter, to allow transports to return information about the refs they have fetched. Then communicate shallow status information through this mechanism instead of by modifying the input list of refs. This does require clients to

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

2018-06-20 Thread Brandon Williams
Refactor the fetch_refs function into a function that does the fetching of refs and another function that stores them. Signed-off-by: Brandon Williams --- builtin/fetch.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c

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

2018-06-20 Thread Stefan Beller
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, but some error messages do not

RE: [PATCH v3 0/7] allocate cache entries from memory pool

2018-06-20 Thread Jameson Miller
> > > We debated several approaches for what to do here > > it would be awesome if the list could participate in the discussion even if > only > read-only. A bit of delay in my response here, but I like the suggestion. here is a summary of some approaches I considered: 1) Do not include any

[PATCH v2] docs: link to gitsubmodules

2018-06-20 Thread Brandon Williams
Add a link to gitsubmodules(7) under the `submodule.active` entry in git-config(1). Signed-off-by: Brandon Williams --- Documentation/config.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index

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

2018-06-20 Thread Taylor Blau
Teach 'git-grep(1)' a new option, '--column', to show the column number of the first match on a non-context line. This makes it possible to teach 'contrib/git-jump/git-jump' how to seek to the first matching position of a grep match in your editor, and allows similar additional scripting

Re: [RFC PATCH v2 1/7] git-rebase.txt: document incompatible options

2018-06-20 Thread Elijah Newren
On Sun, Jun 17, 2018 at 8:38 AM, Phillip Wood wrote: >> +Other incompatible flag pairs: >> + >> + * --preserve-merges && --interactive >> + * --preserve-merges && --signoff >> + * --preserve-merges && --rebase-merges >> + * --rebase-merges && --strategy > > Does --rebase-merges support

Re: [RFC PATCH 01/10] config: make config_from_gitmodules generally useful

2018-06-20 Thread Antonio Ospite
On Mon, 14 May 2018 18:05:19 -0700 Stefan Beller wrote: Hi again Stefan, > On Mon, May 14, 2018 at 3:58 AM, Antonio Ospite wrote: > > The config_from_gitmodules() function is a good candidate for > > a centralized point where to read the gitmodules configuration file. > > It is very tempting

Re: [RFC PATCH 01/10] config: make config_from_gitmodules generally useful

2018-06-20 Thread Antonio Ospite
On Mon, 14 May 2018 11:19:28 -0700 Brandon Williams wrote: Hi Brandon, sorry for the delay, some comments below. > On 05/14, Antonio Ospite wrote: > > The config_from_gitmodules() function is a good candidate for > > a centralized point where to read the gitmodules configuration file. > > > >

[PATCH] packfile: generalize pack directory list

2018-06-20 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 --- Duy, I think this is what you mean by sharing code between packfile.c and midx.c for reading the packfiles

Re: [RFC PATCH v2 1/7] git-rebase.txt: document incompatible options

2018-06-20 Thread Elijah Newren
Hi Eric, On Sun, Jun 17, 2018 at 10:15 AM, Eric Sunshine wrote: > On Sun, Jun 17, 2018 at 1:59 AM Elijah Newren wrote: >> 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:

Re: [RFC PATCH 01/10] config: make config_from_gitmodules generally useful

2018-06-20 Thread Stefan Beller
Hi Antonio! On Wed, Jun 20, 2018 at 11:06 AM Antonio Ospite wrote: > I get that the _content_ of .gitmodules is not meant to be generic > config, but I still see some value in having a single point when its > _location_ is decided. I agree that a single point for the _location_ as well as the

Re: [PATCH 06/23] midx: struct midxed_git and 'read' subcommand

2018-06-20 Thread Derrick Stolee
On 6/20/2018 11:07 AM, Duy Nguyen wrote: On Wed, Jun 20, 2018 at 3:33 PM Derrick Stolee wrote: On 6/7/2018 2:31 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:03 PM, Derrick Stolee wrote: diff --git a/Documentation/git-midx.txt b/Documentation/git-midx.txt index dcaeb1a91b..919283fdd8

Re: [RFC PATCH v2 7/7] git-rebase: make --allow-empty-message the default

2018-06-20 Thread Elijah Newren
Hi Phillip, On Sun, Jun 17, 2018 at 8:30 AM, Phillip Wood wrote: > Looking at the option parsing in git-rebase.sh it appears that it does not > check for --no-allow-empty-message so there's no way to turn off the default > for those modes that support it. I'm not sure what to think of this

Re: [RFC PATCH 02/10] submodule: factor out a config_gitmodules_set function

2018-06-20 Thread Antonio Ospite
On Mon, 14 May 2018 18:20:21 -0700 Stefan Beller wrote: > On Mon, May 14, 2018 at 3:58 AM, Antonio Ospite wrote: > > Introduce a new config_gitmodules_set function to write config values to the > > .gitmodules file. > > > > This is in preparation for a future change which will use the function

Re: Adding nested repository with slash adds files instead of gitlink

2018-06-20 Thread Rafael Ascensão
On Tue, Jun 19, 2018 at 11:28 AM Heiko Voigt wrote: > > Interesting and nobody complained to the mailinglist? > On Wed, Jun 20, 2018 at 3:57 PM Duy Nguyen wrote: > > Abusing a long standing bug does not make it a feature. > To make things clear, I wasn't defending if this should be considered

[PATCH v2 1/7] Documentation/config.txt: camel-case lineNumber for consistency

2018-06-20 Thread Taylor Blau
lineNumber has casing that is inconsistent with surrounding options, like color.grep.matchContext, and color.grep.matchSelected. Re-case this documentation in order to be consistent with the text around it, and to ensure that new entries are consistent, too. Signed-off-by: Taylor Blau ---

[PATCH v2 6/7] grep.c: add configuration variables to show matched option

2018-06-20 Thread Taylor Blau
To support git-grep(1)'s new option, '--column', document and teach grep.c how to interpret relevant configuration options, similar to those associated with '--line-number'. Signed-off-by: Taylor Blau --- Documentation/config.txt | 5 + Documentation/git-grep.txt | 3 +++ grep.c

[PATCH v2 3/7] grep.[ch]: extend grep_opt to allow showing matched column

2018-06-20 Thread Taylor Blau
To support showing the matched column when calling 'git-grep(1)', teach 'grep_opt' the normal set of options to configure the default behavior and colorization of this feature. Now that we have opt->columnnum, use it to disable short-circuiting over ORs so that col and icol are always filled with

[PATCH v2 4/7] grep.c: display column number of first match

2018-06-20 Thread Taylor Blau
To prepare for 'git grep' learning '--column', teach grep.c's show_line() how to show the column of the first match on non-context lines. Signed-off-by: Taylor Blau --- grep.c | 33 - 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/grep.c b/grep.c

[PATCH v2 7/7] contrib/git-jump/git-jump: jump to exact location

2018-06-20 Thread Taylor Blau
Take advantage of 'git-grep(1)''s new option, '--column' in order to teach Peff's 'git-jump' script how to jump to the correct column for any given match. 'git-grep(1)''s output is in the correct format for Vim's jump list, so no additional cleanup is necessary. Signed-off-by: Taylor Blau ---

[PATCH v2 2/7] grep.c: expose {,inverted} match column in match_line()

2018-06-20 Thread Taylor Blau
When calling match_line(), callers presently cannot determine the relative offset of the match because match_line() discards the 'regmatch_t' that contains this information. Instead, teach match_line() to take in two 'ssize_t's. Fill the first with the offset of the match produced by the given

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

2018-06-20 Thread Taylor Blau
Hi, Here is a re-roll of my series to add --column to 'git-grep(1)'. Since last time, not much has changed other than the following: - Fix a typo where 'col', 'icol' were spelled as 'match', 'imatch' [1]. - Disable short-circuiting OR when --column is given [2]. - Disable

Re: t5562: gzip -k is not portable

2018-06-20 Thread Torsten Bögershausen
On Tue, Jun 19, 2018 at 04:53:10PM -0400, Jeff King wrote: > On Tue, Jun 19, 2018 at 10:40:16PM +0200, Torsten Bögershausen wrote: > > > > > > > On 06/19/2018 08:22 PM, Eric Sunshine wrote: > > > On Tue, Jun 19, 2018 at 2:06 PM Junio C Hamano wrote: > > > > Torsten Bögershausen writes: > > >

[PATCH] git-stash.txt: document show options

2018-06-20 Thread Mike Frysinger
Signed-off-by: Mike Frysinger --- Documentation/git-stash.txt | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 7ef8c4791177..76e4ca788102 100644 --- a/Documentation/git-stash.txt +++

Re: [msysGit] Possible git status problem at case insensitive file system

2018-06-20 Thread Philip Oakley
Hi Frank, Your system Clock looks to be providing the wrong date for your emails. The last XP version was https://github.com/git-for-windows/git/releases/tag/v2.10.0.windows.1 so you may want to upgrade to that. (see FAQs https://github.com/git-for-windows/git/wiki/FAQ) It won't solve the

Org

2018-06-20 Thread KoiAnocha
Sent from my iPhone

Re: [GSoC] GSoC with git, week 7

2018-06-20 Thread Pratik Karki
On Tue, Jun 19, 2018 at 12:33 AM, Paul-Sebastian Ungureanu wrote: > Hello! > > > On 18.06.2018 20:34, Alban Gruin wrote: >> >> Hi, >> >> I published a new blog post here: >> >>https://blog.pa1ch.fr/posts/2018/06/18/en/gsoc2018-week-7.html >> >> It’s shorter than the last one, but feel free to

Re: [RFC PATCH 3/3] git-rebase.sh: make git-rebase--interactive the default

2018-06-20 Thread Elijah Newren
Hi Dscho, On Sun, Jun 17, 2018 at 2:44 PM, Johannes Schindelin wrote: > I was really referring to speed. But I have to admit that I do not have > any current numbers. > > Another issue just hit me, though: rebase --am does not need to look at as > many Git objects as rebase --merge or rebase

Re: [PATCH 06/23] midx: struct midxed_git and 'read' subcommand

2018-06-20 Thread Derrick Stolee
On 6/7/2018 1:54 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:03 PM, Derrick Stolee wrote: As we build the multi-pack-index feature by adding chunks at a time, we want to test that the data is being written correctly. Create struct midxed_git to store an in-memory representation of a A

Re: Adding nested repository with slash adds files instead of gitlink

2018-06-20 Thread Duy Nguyen
On Wed, Jun 20, 2018 at 1:55 PM Rafael Ascensão wrote: > > On Wed, Jun 20, 2018 at 5:39 AM Kevin Daudt wrote: > > > > What this is about that when doing `git add path/` (with trailing /), > > > > This is what I was referring to. If you search for 'Fake Submodules', > you'll see that some people

Re: The state of the object store series

2018-06-20 Thread Duy Nguyen
On Wed, Jun 20, 2018 at 12:09 AM Stefan Beller wrote: > "xx/convert-revision-walking" > This series aims to convert get_merge_bases(), in_merge_bases() and all its > revision walking code to take a repository argument. We'll see who gets there first [1] ;-). It does not really matter (and I

Re: t5562: gzip -k is not portable

2018-06-20 Thread Torsten Bögershausen
On Wed, Jun 20, 2018 at 08:40:06AM -0400, Jeff King wrote: > On Wed, Jun 20, 2018 at 08:13:06AM +0200, Torsten Bögershausen wrote: > > > Good eyes, thanks. > > The "-f -c" combo works: > > > > - gzip -k fetch_body && > > + gzip -f -c fetch_body >fetch_body.gz && > >

Re: [PATCH 06/23] midx: struct midxed_git and 'read' subcommand

2018-06-20 Thread Derrick Stolee
On 6/7/2018 2:31 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:03 PM, Derrick Stolee wrote: diff --git a/Documentation/git-midx.txt b/Documentation/git-midx.txt index dcaeb1a91b..919283fdd8 100644 --- a/Documentation/git-midx.txt +++ b/Documentation/git-midx.txt @@ -23,6 +23,11 @@ OPTIONS

Re: Excessive mmap [was Git server eats all memory]

2018-06-20 Thread Duy Nguyen
On Tue, Jun 19, 2018 at 10:27 PM Ivan Kanis wrote: > > Dmitry Potapov wrote: > > > On Fri, Aug 06, 2010 at 07:23:17PM +0200, Ivan Kanis wrote: > >> > >> I expected the malloc to take 4G but was surprised it didn't. It seems > >> to be mmap taking all the memory. I am not familiar with that

Re: What's cooking in git.git (Jun 2018, #05; Mon, 18)

2018-06-20 Thread Junio C Hamano
Jonathan Tan writes: >> 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.

Re: [PATCH 06/23] midx: struct midxed_git and 'read' subcommand

2018-06-20 Thread Duy Nguyen
On Wed, Jun 20, 2018 at 3:33 PM Derrick Stolee wrote: > > On 6/7/2018 2:31 PM, Duy Nguyen wrote: > > On Thu, Jun 7, 2018 at 4:03 PM, Derrick Stolee wrote: > >> diff --git a/Documentation/git-midx.txt b/Documentation/git-midx.txt > >> index dcaeb1a91b..919283fdd8 100644 > >> ---

Re: [PATCH] t3404: check root commit in 'rebase -i --root reword root commit'

2018-06-20 Thread Johannes Schindelin
Hi Junio, On Tue, 19 Jun 2018, Junio C Hamano wrote: > Todd Zullinger writes: > > > index e500d7c320..352a52e59d 100755 > > --- a/t/t3404-rebase-interactive.sh > > +++ b/t/t3404-rebase-interactive.sh > > @@ -977,7 +977,8 @@ test_expect_success 'rebase -i --root reword root > > commit' ' > >

Re: want option to git-rebase

2018-06-20 Thread Ian Jackson
Jonathan Nieder writes ("Re: want option to git-rebase"): > Oh, good catch. "git rebase" already generally does the right thing > when GIT_REFLOG_ACTION is set (by only appending to it and never > replacing it). Great. I indeed did not know about this. > Ian, does that work well for you? If

[ANNOUNCE] Git Rev News edition 40

2018-06-20 Thread Christian Couder
Hi everyone, The 40th edition of Git Rev News is now published: https://git.github.io/rev_news/2018/06/20/edition-40/ Thanks a lot to all the contributors: Adam Spiers, Bryan Turner and Nicolas Pitre! Enjoy, Christian, Jakub, Markus and Gabriel.

Re: [PATCH] t3404: check root commit in 'rebase -i --root reword root commit'

2018-06-20 Thread Johannes Schindelin
Hi Junio, On Tue, 19 Jun 2018, Junio C Hamano wrote: > Todd Zullinger writes: > > > With luck, this will save you a few minutes, assuming the > > commit message is reasonable (or can be improved with help > > from Phillip and others). :) > > OK. > > > Or Junio may just squash this onto

Re: [msysGit] Possible git status problem at case insensitive file system

2018-06-20 Thread Johannes Schindelin
Hi Frank, On Mon, 9 Aug 2010, Frank Li wrote: > All: > I use msysgit 1.7.0.2 at windows xp. > Problem: git status will list tracked directory as untracked dir. That is the *least* problem you have with that version: you are vulnerable to several security issues. Sadly, there

Re: Adding nested repository with slash adds files instead of gitlink

2018-06-20 Thread Rafael Ascensão
On Wed, Jun 20, 2018 at 5:39 AM Kevin Daudt wrote: > > What this is about that when doing `git add path/` (with trailing /), > This is what I was referring to. If you search for 'Fake Submodules', you'll see that some people were/are intentionally using this instead of subtrees or submodules.