Re: Git for Windows v2.20.0-rc0, was Re: [ANNOUNCE] Git v2.20.0-rc0

2018-11-21 Thread Jeff King
On Tue, Nov 20, 2018 at 03:17:07PM -0800, Bryan Turner wrote: > I've run 2.20.0-rc0 through the test matrix for Bitbucket Server on > both Linux and Windows, and the only failures were related to this > change: > > * "git branch -l " used to be a way to ask a reflog to be >created while

Re: [PATCH v2 1/2] ref-filter: add worktree atom

2018-11-21 Thread Jeff King
On Wed, Nov 21, 2018 at 03:05:04PM +0100, Nickolai Belakovski wrote: > I think if we move to making this atom just store worktree path, that > needs to be implemented as a hashmap of refname->wtpath, which would > also solve this string_list issue, correct? Just making sure I'm not > missing

Re: git grep prints colon instead of slash

2018-11-21 Thread Jeff King
On Wed, Nov 21, 2018 at 02:54:34PM +0100, Marc Gonzalez wrote: > If I specify the branch to explore, git grep prints a colon instead of > a slash in the path: > > $ git grep arm,coresight-tmc master:Documentation/devicetree > master:Documentation/devicetree:bindings/arm/coresight.txt:

Re: pathspec: problems with too long command line

2018-11-21 Thread Jeff King
On Wed, Nov 21, 2018 at 10:23:34AM +0100, Marc Strapetz wrote: > From our GUI client we are invoking git operations on a possibly large set > of files. This may result in pathspecs which are exceeding the maximum > command line length, especially on Windows [1] and OSX [2]. To workaround > this

Re: Git Test Coverage Report (v2.20.0-rc0)

2018-11-20 Thread Jeff King
On Tue, Nov 20, 2018 at 07:17:46AM -0500, Derrick Stolee wrote: > > And I think that's a pattern with the delta-island code. What we really > > care about most is that if we throw a real fork-network repository at > > it, it produces faster clones with fewer un-reusable deltas. So I think > > a

Re: [PATCH] test-lib-functions: make 'test_cmp_rev' more informative on failure

2018-11-20 Thread Jeff King
On Tue, Nov 20, 2018 at 12:25:38PM +0100, SZEDER Gábor wrote: > > but we do not > > usually bother to do so for our helper functions (like test_cmp). > > test_i18ngrep() does since your 03aa3783f2 (t: send verbose > test-helper output to fd 4, 2018-02-22). Oh, indeed. Usually I find myself

Re: Git Test Coverage Report (v2.20.0-rc0)

2018-11-20 Thread Jeff King
On Mon, Nov 19, 2018 at 10:40:53AM -0500, Derrick Stolee wrote: > > 28b8a73080 builtin/pack-objects.c 2793) depth++; > > 108f530385 builtin/pack-objects.c 2797) oe_set_tree_depth(_pack, ent, > > depth); > > This 'depth' variable is incremented as part of a for loop in this patch: > >  static

Re: [PATCH] tests: send "bug in the test script" errors to the script's stderr

2018-11-20 Thread Jeff King
On Tue, Nov 20, 2018 at 05:45:28AM -0500, Jeff King wrote: > On Tue, Nov 20, 2018 at 12:34:04AM +0100, SZEDER Gábor wrote: > > > > I do notice that many of the existing "FATAL:" errors use descriptor 5, > > > which goes to stdout. I'm not sure if those should

Re: [PATCH] tests: send "bug in the test script" errors to the script's stderr

2018-11-20 Thread Jeff King
On Tue, Nov 20, 2018 at 12:34:04AM +0100, SZEDER Gábor wrote: > > I do notice that many of the existing "FATAL:" errors use descriptor 5, > > which goes to stdout. I'm not sure if those should actually be going to > > stderr (or if there's some TAP significance to those lines). > > I chose to

[PATCH 3/3] pack-objects: fix off-by-one in delta-island tree-depth computation

2018-11-20 Thread Jeff King
small effect. Some experiments on the real-world git/git fork network at GitHub showed an improvement of only 0.14% in the resulting clone size. Signed-off-by: Jeff King --- builtin/pack-objects.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/pack-objects.c b/b

[PATCH 2/3] pack-objects: zero-initialize tree_depth/layer arrays

2018-11-20 Thread Jeff King
but they'll be initialized by packlist_alloc() when it initializes the entry in the "objects" array). So it works, but only by chance. To be defensive, let's zero the array, which matches the "unset" values which would be handed out by oe_tree_depth() already. Signed-off-by:

[PATCH 1/3] pack-objects: fix tree_depth and layer invariants

2018-11-20 Thread Jeff King
array to match pack->nr_alloc, not pack->nr_objects. Likewise for the "layer" array from fe0ac2fb7f (pack-objects: move 'layer' into 'struct packing_data', 2018-08-16), which has the same bug. Signed-off-by: Jeff King --- pack-objects.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletion

[PATCH 0/3] delta-island fixes

2018-11-20 Thread Jeff King
This fixes a few bugs in the cc/delta-islands topic: one major, and two minor. Sadly, the major one was not caught by our test suite, and I'm not sure how to remedy that. The problem is a memory management one, and happens only when you have a reasonably large number of objects. So it triggers

Re: [PATCH] t5562: skip if NO_CURL is enabled

2018-11-20 Thread Jeff King
On Mon, Nov 19, 2018 at 11:36:08AM -0800, Carlo Arenas wrote: > tests 3-8 seem to fail because perl is hardcoded to /urs/bin/perl in > t5562/invoke-with-content-length.pl, while I seem to be getting some > sporadic errors in 9 with the following output : > > ++ env

Re: [PATCH] t5562: skip if NO_CURL is enabled

2018-11-19 Thread Jeff King
On Mon, Nov 19, 2018 at 11:26:03PM +0200, Max Kirillov wrote: > On Mon, Nov 19, 2018 at 11:36:08AM -0800, Carlo Arenas wrote: > > NO_CURL reflects the build setting (for http support); CURL checks for > > the curl binary, but as Ævar points out the requirements must be from > > somewhere else

Re: [PATCH] test-lib-functions: make 'test_cmp_rev' more informative on failure

2018-11-19 Thread Jeff King
On Mon, Nov 19, 2018 at 02:28:18PM +0100, SZEDER Gábor wrote: > The 'test_cmp_rev' helper is merely a wrapper around 'test_cmp' > checking the output of two 'git rev-parse' commands, which means that > its output on failure is not particularly informative, as it's > basically two OIDs with a bit

Re: [PATCH] tests: send "bug in the test script" errors to the script's stderr

2018-11-19 Thread Jeff King
On Mon, Nov 19, 2018 at 02:13:26PM +0100, SZEDER Gábor wrote: > Send these "bug in the test script" error messages directly to the > test scripts standard error and thus to the terminal, so those bugs > will be much harder to overlook. Instead of updating all ~20 such > 'error' calls with a

Re: Git Test Coverage Report (v2.20.0-rc0)

2018-11-19 Thread Jeff King
On Mon, Nov 19, 2018 at 11:21:38AM -0500, Jeff King wrote: > > +   if (use_delta_islands) { > > +   const char *p; > > +   unsigned depth = 0; > > +   struct object_entry *ent; > > + > > +   for (p = st

Re: Git Test Coverage Report (v2.20.0-rc0)

2018-11-19 Thread Jeff King
On Mon, Nov 19, 2018 at 10:40:53AM -0500, Derrick Stolee wrote: > > 2fa233a554 builtin/pack-objects.c 1512) hashcpy(base_oid.hash, > > base_sha1); > > 2fa233a554 builtin/pack-objects.c 1513) if > > (!in_same_island(>idx.oid, _oid)) > > 2fa233a554 builtin/pack-objects.c 1514) return 0; > > These

Re: [PATCH 0/5] Make :(attr) pathspec work with "git log"

2018-11-19 Thread Jeff King
On Sun, Nov 18, 2018 at 08:51:52PM +0100, Ævar Arnfjörð Bjarmason wrote: > > But this also reveals an interesting thing: even though we walk on a > > tree, we check attributes from _worktree_ (and optionally fall back to > > the index). This is how attributes are implemented since forever. I > >

Re: how often do you check in and with what tool(s)?

2018-11-19 Thread Jeff King
On Tue, Nov 13, 2018 at 06:04:15PM -0500, _g e r r y _ _l o w r y _ wrote: > Examples: > > {me, extreme often, Windows} very granular, with a brief yet appropriate > comment [like narrating a story] per commit-i change a few > lines of code, > Alt+Tab to Git Bash, Git Add/Commit, > Alt+Tab

Re: [PATCH] msvc: Directly use MS version (_stricmp) of strcasecmp

2018-11-18 Thread Jeff King
On Sun, Nov 18, 2018 at 10:02:02PM +0100, Sven Strickroth wrote: > This also removes an implicit conversion from size_t (unsigned) to int > (signed). > > _stricmp as well as _strnicmp are both available since VS2012. Once upon a time we had problems with taking a function pointer of strcasecmp

Re: insteadOf and git-request-pull output

2018-11-17 Thread Jeff King
On Sat, Nov 17, 2018 at 04:46:22PM +0900, Junio C Hamano wrote: > "brian m. carlson" writes: > > >> $ git request-pull HEAD^ git://foo.example.com/example | grep example > >> ssh://bar.example.com/example > >> > >> I think that if we use the "principle of least surprise," insteadOf > >>

Re: [RFC/PATCH 0/5] stop installing old libexec aliases like "git-init"

2018-11-16 Thread Jeff King
On Fri, Nov 16, 2018 at 08:22:11PM +0100, Ævar Arnfjörð Bjarmason wrote: > So maybe we should just document this interface better. It seems one > implicit dependency is that we expect a manpage for the tool to exist > for --help. Yeah, I think this really the only problematic assumption. The

[PATCH] bundle: dup() output descriptor closer to point-of-use

2018-11-16 Thread Jeff King
trigger (the other likely errors are write() problems like ENOSPC). Note that it would already pass on non-Windows systems (because they are happy to unlink an already-open file). Based-on-a-patch-by: Gaël Lhez Signed-off-by: Jeff King --- bundle.c| 39 ++

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-11-16 Thread Jeff King
On Fri, Nov 16, 2018 at 02:09:07PM +0900, Junio C Hamano wrote: > >> I see problems in both directions: > >> > >> - sorting by "objectname" works now, but it's marked with SOURCE_OBJ, > >>and would be forbidden with your patch. I'm actually not sure if > >>SOURCE_OBJ is accurate; we

[PATCH 3/3] remote-curl: die on server-side errors

2018-11-16 Thread Jeff King
for this issue. Signed-off-by: Josh Steadmon Signed-off-by: Jeff King --- remote-curl.c | 3 +++ t/lib-httpd.sh | 1 + t/lib-httpd/apache.conf | 4 t/lib-httpd/error-smart-http.sh | 3 +++ t/t5551-http-fetch-smart.sh | 5 + 5 files changed

Re: [PATCH v3 00/11] fast export and import fixes and features

2018-11-16 Thread Jeff King
On Thu, Nov 15, 2018 at 11:59:45PM -0800, Elijah Newren wrote: > This is a series of small fixes and features for fast-export and > fast-import, mostly on the fast-export side. > > Changes since v2 (full range-diff below): > * Dropped the final patch; going to try to use Peff's suggestion of >

[PATCH 2/3] remote-curl: tighten "version 2" check for smart-http

2018-11-16 Thread Jeff King
20", for example). Let's tighten this check to use strcmp(). Note that we don't need to worry about a trailing newline here, because the ptk-line code will have chomped it for us already. Signed-off-by: Jeff King --- remote-curl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 1/3] remote-curl: refactor smart-http discovery

2018-11-16 Thread Jeff King
http-protocol.txt, l. 247 Helped-by: Josh Steadmon Signed-off-by: Jeff King --- remote-curl.c | 93 --- 1 file changed, 59 insertions(+), 34 deletions(-) diff --git a/remote-curl.c b/remote-curl.c index 762a55a75f..dd9bc41aa1 100644 --- a/remote

[PATCH 0/3] remote-curl smart-http discovery cleanup

2018-11-16 Thread Jeff King
On Thu, Nov 15, 2018 at 01:51:52PM -0800, Josh Steadmon wrote: > > This patch tightens both of those (I also made a few stylistic tweaks, > > and added the ERR condition to show where it would go). I dunno. Part of > > me sees this as a nice cleanup, but maybe it is better to just leave it > >

Re: [PATCH v2 1/1] bundle: cleanup lock files on error

2018-11-15 Thread Jeff King
On Thu, Nov 15, 2018 at 05:32:15PM +0100, Johannes Schindelin wrote: > I cannot claim that I wrapped my head around your explanation or your diff (I > am > busy trying to prepare Git for Windows' `master` for rebasing to v2.20.0-rc0), > but it does fix the problem. Thank you so much! > > The

Re: approxidate woes

2018-11-15 Thread Jeff King
On Thu, Nov 15, 2018 at 09:48:54AM -0500, Jeff King wrote: > I don't think "48h" does what you expect either: > > $ t/helper/test-date approxidate now > now -> 2018-11-15 14:43:32 + > > $ t/helper/test-date approxidate 48h > 48h -> 2018-11-15

Re: approxidate woes

2018-11-15 Thread Jeff King
On Thu, Nov 15, 2018 at 02:45:28PM +0100, Andreas Krey wrote: > I've now located why our backup repo shrinks every month: > > git gc --prune=2d > > doesn't do what I expected, and differs a lot from --prune=48h. Yeah, it understands "2 days", but not "d" as a unit. I don't think "48h" does

Re: [RFC] cherry-pick notes to find out cherry-picks from the origin

2018-11-15 Thread Jeff King
On Wed, Oct 17, 2018 at 07:39:21AM -0700, Tejun Heo wrote: > A while ago, I proposed changes to name-rev and describe so that they > can identify the commits cherry-picked from the one which is being > shown. > > >

Re: [PATCH v2 1/1] bundle: cleanup lock files on error

2018-11-15 Thread Jeff King
On Thu, Nov 15, 2018 at 01:57:45PM +0100, Johannes Schindelin wrote: > > I looked at the test to see if it would pass, but it is not even > > checking anything about lockfiles! It just checks that we exit 1 by > > returning up the callstack instead of calling die(). And of course it > > would not

Re: [PATCH 2/5] tests: respect GIT_TEST_INSTALLED when initializing repositories

2018-11-15 Thread Jeff King
On Thu, Nov 15, 2018 at 01:29:58PM +0100, Johannes Schindelin wrote: > > Do we actually care where the templates are? I thought the point was to > > override for the built Git to use the built templates instead of the > > installed one. For an installed Git, shouldn't we not be overriding the > >

Re: [PATCH 0/3] clone: respect configured fetch respecs during initial fetch

2018-11-15 Thread Jeff King
On Wed, Nov 14, 2018 at 11:46:17AM +0100, SZEDER Gábor wrote: > This patch series should have been marked as v6, but I chose to reset > the counter, because: > > - v5 was sent out way over a year ago [1], and surely everybody has > forgotten about it since then anyway. But more

Re: [PATCH 3/3] Documentation/clone: document ignored configuration variables

2018-11-15 Thread Jeff King
On Wed, Nov 14, 2018 at 11:46:20AM +0100, SZEDER Gábor wrote: > Due to limitations in the current implementation, some configuration > variables specified via 'git clone -c var=val' (or 'git -c var=val > clone') are ignored during the initial fetch and checkout. > > Let the users know which

Re: [PATCH 2/3] clone: respect additional configured fetch refspecs during initial fetch

2018-11-15 Thread Jeff King
On Wed, Nov 14, 2018 at 11:46:19AM +0100, SZEDER Gábor wrote: > The initial fetch during a clone doesn't transfer refs matching > additional fetch refspecs given on the command line as configuration > variables, e.g. '-c remote.origin.fetch='. This contradicts > the documentation stating that

Re: [PATCH 1/3] clone: use a more appropriate variable name for the default refspec

2018-11-15 Thread Jeff King
On Wed, Nov 14, 2018 at 11:46:18AM +0100, SZEDER Gábor wrote: > cmd_clone() declares two strbufs 'key' and 'value' on the same line, > suggesting that they are used to contruct a config variable's name and > value. However, this is not the case: 'key' is used to construct the > names of multiple

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-11-15 Thread Jeff King
On Thu, Nov 15, 2018 at 04:38:44AM -0500, Jeff King wrote: > Is SOURCE_NONE a complete match for what we want? > > I see problems in both directions: > > - sorting by "objectname" works now, but it's marked with SOURCE_OBJ, >and would be forbidden with your p

Re: [PATCH v4] commit: add a commit.allowEmpty config variable

2018-11-15 Thread Jeff King
On Thu, Nov 15, 2018 at 09:40:38AM +0100, Johannes Schindelin wrote: > From @chucklu: > > > my user case is like this : > > > > When I want to cherr-pick commits from A to G (ABCDEFG), image C and E > > are merge commits. Then I will get lots of popup like: > > > >The previous cherry-pick

Re: [PATCH] ref-filter: don't look for objects when outside of a repository

2018-11-15 Thread Jeff King
On Wed, Nov 14, 2018 at 01:27:25PM +0100, SZEDER Gábor wrote: > The command 'git ls-remote --sort=authordate ' segfaults when > run outside of a repository, ever since the introduction of its > '--sort' option in 1fb20dfd8e (ls-remote: create '--sort' option, > 2018-04-09). > > While in general

Re: [PATCH v2 1/1] bundle: cleanup lock files on error

2018-11-14 Thread Jeff King
On Wed, Nov 14, 2018 at 02:08:48PM -0800, Stefan Beller wrote: > On Wed, Nov 14, 2018 at 1:43 PM Martin Ågren wrote: > > > > On Wed, 14 Nov 2018 at 16:26, Gaël Lhez via GitGitGadget > > wrote: > > > However, the `.lock` file was still open and on Windows that means > > > that it could not be

Re: [PATCH v2 1/1] config: report a bug if git_dir exists without commondir

2018-11-14 Thread Jeff King
On Wed, Nov 14, 2018 at 05:59:02AM -0800, Johannes Schindelin via GitGitGadget wrote: > From: Johannes Schindelin > > This did happen at some stage, and was fixed relatively quickly. Make > sure that we detect very quickly, too, should that happen again. > > Signed-off-by: Johannes Schindelin

Re: [PATCH 2/5] tests: respect GIT_TEST_INSTALLED when initializing repositories

2018-11-14 Thread Jeff King
On Wed, Nov 14, 2018 at 02:16:37PM +0100, Johannes Schindelin wrote: > > Makes perfect sense. Shouldn't we be asking where the template > > directory of the installed version is and using it instead of the > > freshly built one, no? > > It would make sense, but we don't know how to get that

Re: [ANNOUNCE] Git Merge Contributor's Summit Jan 31, 2019, Brussels

2018-11-14 Thread Jeff King
On Wed, Nov 14, 2018 at 12:31:22PM +, Luke Diamand wrote: > On Fri, 9 Nov 2018 at 10:48, Jeff King wrote: > > > > On Fri, Nov 09, 2018 at 10:44:10AM +, Luca Milanesio wrote: > > > > > > On 9 Nov 2018, at 10:42, Jeff King wrote: > > > > > &

Re: [PATCH 4/5] tests: do not require Git to be built when testing an installed Git

2018-11-14 Thread Jeff King
On Mon, Nov 12, 2018 at 05:48:37AM -0800, Johannes Schindelin via GitGitGadget wrote: > diff --git a/t/test-lib.sh b/t/test-lib.sh > index 832ede5099..1ea20dc2dc 100644 > --- a/t/test-lib.sh > +++ b/t/test-lib.sh > @@ -51,7 +51,7 @@ export LSAN_OPTIONS > >

Re: [PATCH 0/1] Some left-over add-on for bw/config-h

2018-11-13 Thread Jeff King
On Wed, Nov 14, 2018 at 02:52:24PM +0900, Junio C Hamano wrote: > "Johannes Schindelin via GitGitGadget" > writes: > > > Back when bw/config-h was developed (and backported to Git for Windows), I > > came up with this patch. It seems to not be strictly necessary, but I like > > the safety of

Re: [PATCH 0/1] rebase: understand -C again, refactor

2018-11-13 Thread Jeff King
On Tue, Nov 13, 2018 at 04:38:24AM -0800, Johannes Schindelin via GitGitGadget wrote: > Phillip Wood reported a problem where the built-in rebase did not understand > options like -C1, i.e. it did not expect the option argument. > > While investigating how to address this best, I stumbled upon

Re: [PATCH v2 00/11] fast export and import fixes and features

2018-11-13 Thread Jeff King
On Tue, Nov 13, 2018 at 04:25:49PM -0800, Elijah Newren wrote: > This is a series of small fixes and features for fast-export and > fast-import, mostly on the fast-export side. I looked over this, and I think you've addressed all of my questions. A few quick comments: > Changes since v1 (full

Re: [PATCH 10/10] fast-export: add --always-show-modify-after-rename

2018-11-13 Thread Jeff King
On Tue, Nov 13, 2018 at 09:10:36AM -0800, Elijah Newren wrote: > > I am looking at this problem as "how do you answer question X in a > > repository". And I think you are looking at as "I am receiving a > > fast-export stream, and I need to answer question X on the fly". > > > > And that would

Re: [PATCH] remote-curl: die on server-side errors

2018-11-13 Thread Jeff King
On Tue, Nov 13, 2018 at 07:49:15PM -0500, Jeff King wrote: > Yes, the packet_read_line_buf() interface will both advance the buf > pointer and decrement the length. So if we want to "peek", we have to > do so with a copy (there's a peek function if you use the packet

Re: [PATCH v5 02/12] sha1-file: provide functions to look up hash algorithms

2018-11-13 Thread Jeff King
On Wed, Nov 14, 2018 at 12:42:45AM +, Ramsay Jones wrote: > BTW, if you were puzzling over the 3rd symbol from sha1-file.o > (which I wasn't counting in the 4 symbols above! ;-) ), then I > believe that is because Jeff's commit 3a2e08245c ("object-store: > provide helpers for

Re: [PATCH] remote-curl: die on server-side errors

2018-11-13 Thread Jeff King
On Tue, Nov 13, 2018 at 02:25:40PM -0800, Josh Steadmon wrote: > > The magic "4" here and in the existing "version 2" check is because we > > are expecting pkt-lines. The original conditional always calls > > packed_read_line_buf() and will complain if we didn't actually get a > > pkt-line. > >

Re: [PATCH v2 2/2] branch: Mark and colorize a branch differently if it is checked out in a linked worktree

2018-11-13 Thread Jeff King
On Mon, Nov 12, 2018 at 06:07:18PM +, Rafael Ascensão wrote: > On Mon, Nov 12, 2018 at 07:14:23AM -0500, Jeff King wrote: > > just adding a bunch of color variants. It would be nice if we could just > > do this with a run-time parse_color("bold red"

Re: [PATCH 10/10] fast-export: add --always-show-modify-after-rename

2018-11-13 Thread Jeff King
On Mon, Nov 12, 2018 at 10:08:10AM -0800, Elijah Newren wrote: > > I would do: > > > >git log --raw $( > > git cat-file --batch-check='%(objectsize:disk) %(objectname)' > > --batch-all-objects | > > sort -rn | head -3 | > > awk '{print "--find-object=" $2 }' > >) > > > >

Re: [PATCH 04/10] fast-export: avoid dying when filtering by paths and old tags exist

2018-11-13 Thread Jeff King
On Mon, Nov 12, 2018 at 10:50:43PM +, brian m. carlson wrote: > On Sun, Nov 11, 2018 at 01:44:43AM -0500, Jeff King wrote: > > > + git fast-export --tag-of-filtered-object=rewrite --all -- bar > > > >output && > > > + grep -A 1 refs/t

Re: [PATCH] remote-curl: die on server-side errors

2018-11-13 Thread Jeff King
On Mon, Nov 12, 2018 at 02:44:56PM -0800, stead...@google.com wrote: > When a smart HTTP server sends an error message via pkt-line, > remote-curl will fail to detect the error (which usually results in > incorrectly falling back to dumb-HTTP mode). > > This patch adds a check in discover_refs()

Re: [PATCH 7/9] object-store: provide helpers for loose_objects_cache

2018-11-12 Thread Jeff King
On Mon, Nov 12, 2018 at 08:24:59PM +0100, René Scharfe wrote: > > +void odb_load_loose_cache(struct object_directory *odb, int subdir_nr) > > +{ > > + struct strbuf buf = STRBUF_INIT; > > + > > + if (subdir_nr < 0 || > > Why not make subdir_nr unsigned (like in

Re: [PATCH 9/9] fetch-pack: drop custom loose object cache

2018-11-12 Thread Jeff King
On Mon, Nov 12, 2018 at 08:32:43PM +0100, Ævar Arnfjörð Bjarmason wrote: > >>for (ref = *refs; ref; ref = ref->next) { > >>struct object *o; > >> - unsigned int flags = OBJECT_INFO_QUICK; > >> > >> - if (use_oidset && > >> -

Re: [PATCH 09/10] fast-export: add a --show-original-ids option to show original names

2018-11-12 Thread Jeff King
On Mon, Nov 12, 2018 at 07:46:14AM -0800, Elijah Newren wrote: > So maybe my commit message should have been something > more like: > > """ > Knowing the original names (hashes) of commits can sometimes enable > post-filtering that would otherwise be difficult or impossible. In > particular,

Re: [PATCH 8/9] sha1-file: use loose object cache for quick existence check

2018-11-12 Thread Jeff King
On Mon, Nov 12, 2018 at 05:01:02PM +0100, Ævar Arnfjörð Bjarmason wrote: > > There's some obvious hand-waving in the paragraphs above. I would love > > it if somebody with an NFS system could do some before/after timings > > with various numbers of loose objects, to get a sense of where the > >

Re: [PATCH 6/9] sha1-file: use an object_directory for the main object dir

2018-11-12 Thread Jeff King
On Mon, Nov 12, 2018 at 10:48:36AM -0500, Derrick Stolee wrote: > > If the "the first one is the main store, the rest are alternates" bit is > > too subtle, we could mark each "struct object_directory" with a bit for > > "is_local". > > This is probably a good thing to do proactively. We have

Re: [PATCH 5/9] handle alternates paths the same as the main object dir

2018-11-12 Thread Jeff King
On Mon, Nov 12, 2018 at 10:38:28AM -0500, Derrick Stolee wrote: > > We could go either direction here, but this patch moves the alternates > > struct over to the main directory style (rather than vice-versa). > > Technically the alternates style is more efficient, as it avoids > > rewriting the

Re: [PATCH 3/9] rename "alternate_object_database" to "object_directory"

2018-11-12 Thread Jeff King
On Mon, Nov 12, 2018 at 10:30:55AM -0500, Derrick Stolee wrote: > On 11/12/2018 9:48 AM, Jeff King wrote: > > In preparation for unifying the handling of alt odb's and the normal > > repo object directory, let's use a more neutral name. This patch is > > purely mechanical, s

[PATCH 9/9] fetch-pack: drop custom loose object cache

2018-11-12 Thread Jeff King
might spend a lot of time on readdir() if you have a lot of loose objects, even though there are very few objects to ask about. In practice it probably won't matter either way; see the previous commit for some discussion of the tradeoff. Signed-off-by: Jeff King --- fetch-pack.c | 39

[PATCH 8/9] sha1-file: use loose object cache for quick existence check

2018-11-12 Thread Jeff King
ow up front how many lookups we're going to do. But it's unlikely for this to perform significantly worse. Signed-off-by: Jeff King --- There's some obvious hand-waving in the paragraphs above. I would love it if somebody with an NFS system could do some before/after timings with various numb

[PATCH 7/9] object-store: provide helpers for loose_objects_cache

2018-11-12 Thread Jeff King
to allow more code to use it. For instance, fetch-pack explicitly re-reads the object directory after performing its fetch, and would be confused if we didn't clear the cache. Signed-off-by: Jeff King --- object-store.h | 18 +- packfile.c | 8 sha1-file.c| 26

[PATCH 6/9] sha1-file: use an object_directory for the main object dir

2018-11-12 Thread Jeff King
e an exception, because they have entry points to handle local and nonlocal directories separately. Signed-off-by: Jeff King --- If the "the first one is the main store, the rest are alternates" bit is too subtle, we could mark each "struct object_directory" with a bit for

[PATCH 5/9] handle alternates paths the same as the main object dir

2018-11-12 Thread Jeff King
a pointer to the filled buffer, which makes a few conversions more convenient. Signed-off-by: Jeff King --- object-store.h | 14 +- object.c | 1 - sha1-file.c| 44 sha1-name.c| 8 ++-- 4 files changed, 23 insertions

[PATCH 4/9] sha1_file_name(): overwrite buffer instead of appending

2018-11-12 Thread Jeff King
from topics in flight). Signed-off-by: Jeff King --- http-walker.c | 2 +- http.c | 4 ++-- object-store.h | 2 +- sha1-file.c| 18 -- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/http-walker.c b/http-walker.c index b3334bf657..0a392c85b6

[PATCH 3/9] rename "alternate_object_database" to "object_directory"

2018-11-12 Thread Jeff King
ill reduce the noise in subsequent diffs. Signed-off-by: Jeff King --- I waffled on calling this object_database instead of object_directory. But really, it is very specifically about the directory (packed storage, including packs from alternates, is handled elsewhere). builtin/count-objects.c

[PATCH 1/9] fsck: do not reuse child_process structs

2018-11-12 Thread Jeff King
, and may break in the future; let's reinitialize our struct for each program we run. Signed-off-by: Jeff King --- builtin/fsck.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/builtin/fsck.c b/builtin/fsck.c index 06eb421720..b10f2b154c 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @

[PATCH 0/9] caching loose objects

2018-11-12 Thread Jeff King
Here's the series I mentioned earlier in the thread to cache loose objects when answering has_object_file(..., OBJECT_INFO_QUICK). For those just joining us, this makes operations that look up a lot of missing objects (like "index-pack" looking for collisions) faster. This is mostly targeted at

[PATCH 2/9] submodule--helper: prefer strip_suffix() to ends_with()

2018-11-12 Thread Jeff King
Using strip_suffix() lets us avoid repeating ourselves. It also makes the handling of "/" a bit less subtle (we strip one less character than we matched in order to leave it in place, but we can just as easily include the "/" when we add more path components). Sign

Re: [RFC PATCH] index-pack: improve performance on NFS

2018-11-12 Thread Jeff King
On Sat, Nov 10, 2018 at 03:04:35PM +0100, Ævar Arnfjörð Bjarmason wrote: > d) As shown in the linked E-Mails of mine you sometimes pay a 2-3 second >*fixed* cost even for a very small (think ~100-200 objects) push/fetch >that would otherwise take milliseconds with Jeff's version of this >

Re: [RFC PATCH] index-pack: improve performance on NFS

2018-11-12 Thread Jeff King
On Thu, Nov 08, 2018 at 11:20:47PM +0100, Ævar Arnfjörð Bjarmason wrote: > Just a comment on this from the series: > > Note that it is possible for this to actually be _slower_. We'll do a > full readdir() to fill the cache, so if you have a very large number of > loose objects and a

Re: [RFC PATCH 1/5] ref-filter: add objectsize:disk option

2018-11-12 Thread Jeff King
On Mon, Nov 12, 2018 at 01:03:25PM +0100, Johannes Schindelin wrote: > > oi.disk_size is off_t; do we know "long long" > > > >(1) is available widely enough (I think it is from c99)? > > > >(2) is sufficiently wide so that we can safely cast off_t to? > > > >(3) will stay to be

Re: [RFC PATCH 1/5] ref-filter: add objectsize:disk option

2018-11-12 Thread Jeff King
On Mon, Nov 12, 2018 at 02:03:20PM +0900, Junio C Hamano wrote: > > + } else if (!strcmp(name, "objectsize")) { > > v->value = oi->size; > > v->s = xstrfmt("%lu", oi->size); > > This is not a suggestion but is a genuine question, but I wonder if

Re: [PATCH 00/10] fast export and import fixes and features

2018-11-12 Thread Jeff King
On Sun, Nov 11, 2018 at 12:44:47AM -0800, Elijah Newren wrote: > > > These patches were driven by the needs of git-repo-filter[1], but most > > > if not all of them should be independently useful. > > > > I left lots of comments. Some of the earlier ones may just be showing my > > confusion about

Re: [PATCH 10/10] fast-export: add --always-show-modify-after-rename

2018-11-12 Thread Jeff King
On Sun, Nov 11, 2018 at 12:42:58AM -0800, Elijah Newren wrote: > > > fast-export output is traditionally used as an input to a fast-import > > > program, but it is also useful to help gather statistics about the > > > history of a repository (particularly when --no-data is also passed). > > > For

Re: [PATCH 09/10] fast-export: add a --show-original-ids option to show original names

2018-11-12 Thread Jeff King
On Sun, Nov 11, 2018 at 12:32:22AM -0800, Elijah Newren wrote: > > > Documentation/git-fast-export.txt | 7 +++ > > > builtin/fast-export.c | 20 +++- > > > fast-import.c | 17 + > > > t/t9350-fast-export.sh| 17

Re: [PATCH 06/10] fast-export: when using paths, avoid corrupt stream with non-existent mark

2018-11-12 Thread Jeff King
On Sun, Nov 11, 2018 at 12:01:43AM -0800, Elijah Newren wrote: > > It does seem funny that the behavior for the earlier case (bounded > > commits) and this case (skipping some commits) are different. Would you > > ever want to keep walking backwards to find an ancestor in the earlier > > case? Or

Re: [PATCH 04/10] fast-export: avoid dying when filtering by paths and old tags exist

2018-11-12 Thread Jeff King
On Sat, Nov 10, 2018 at 11:38:45PM -0800, Elijah Newren wrote: > > Hmm. That's the right thing to do if we're considering the export to be > > an independent unit. But what if I'm just rewriting a portion of history > > like: > > > > git fast-export HEAD~5..HEAD | some_filter | git fast-import

Re: Migration to Git LFS inflates repository multiple times

2018-11-12 Thread Jeff King
On Mon, Nov 12, 2018 at 12:47:42AM +0100, Mateusz Loskot wrote: > Hi, > > I'm posting here for the first time and I hope it's the right place to ask > questions about Git LFS. > > TL;TR: Is this normal a repository migrated to Git LFS inflates multiple times > and how to deal with it? That

Re: [PATCH v2 1/1] Upcast size_t variables to uintmax_t when printing

2018-11-12 Thread Jeff King
On Sun, Nov 11, 2018 at 11:16:50AM +0100, Torsten Bögershausen wrote: > > I like the overall direction. I feel a little funny doing this step now, > > and not as part of a series to convert individual variables. But I > > cannot offhand think of any reason that it would behave badly even if > >

Re: [PATCH v2 1/2] ref-filter: add worktree atom

2018-11-12 Thread Jeff King
On Sun, Nov 11, 2018 at 03:58:30PM -0800, nbelakov...@gmail.com wrote: > From: Nickolai Belakovski > > Add an atom expressing whether the particular ref is checked out in a > linked worktree. > > Signed-off-by: Nickolai Belakovski > --- > ref-filter.c | 31

Re: [PATCH v2 1/2] ref-filter: add worktree atom

2018-11-12 Thread Jeff King
On Mon, Nov 12, 2018 at 07:11:23PM +0900, Junio C Hamano wrote: > > + } > > + > > + string_list_sort(>u.worktree_heads); > > + > > + free_worktrees(worktrees); > > + return 0; > > +} > > So..., this function collects any and all branches that are checked > out in some worktree, and sort

Re: [PATCH v2 2/2] branch: Mark and colorize a branch differently if it is checked out in a linked worktree

2018-11-12 Thread Jeff King
On Mon, Nov 12, 2018 at 07:20:28PM +0900, Junio C Hamano wrote: > nbelakov...@gmail.com writes: > > > diff --git a/color.h b/color.h > > index 98894d6a17..857653df73 100644 > > --- a/color.h > > +++ b/color.h > > @@ -42,6 +42,24 @@ struct strbuf; > > #define GIT_COLOR_FAINT_BLUE

Re: [PATCH 03/10] fast-export: use value from correct enum

2018-11-12 Thread Jeff King
On Sun, Nov 11, 2018 at 09:10:17PM +0100, Ævar Arnfjörð Bjarmason wrote: > > This is a good argument for naming these SIGNED_TAG_ABORT, etc. But this > > is obviously an improvement in the meantime. > > In C enum values aren't the types of the enum, but I'd thought someone > would have added a

Re: [PATCH v2 1/1] Upcast size_t variables to uintmax_t when printing

2018-11-10 Thread Jeff King
On Sun, Nov 11, 2018 at 08:05:04AM +0100, tbo...@web.de wrote: > From: Torsten Bögershausen > > When printing variables which contain a size, today "unsigned long" > is used at many places. > In order to be able to change the type from "unsigned long" into size_t > some day in the future, we

Re: [PATCH 00/10] fast export and import fixes and features

2018-11-10 Thread Jeff King
On Sat, Nov 10, 2018 at 10:23:02PM -0800, Elijah Newren wrote: > This is a series of ten patches representing two doc corrections, one > pedantic fix, three real bug fixes, one micro code refactor, and three > new features. Each of these ten changes is relatively small in size. > These changes

Re: [PATCH 10/10] fast-export: add --always-show-modify-after-rename

2018-11-10 Thread Jeff King
On Sat, Nov 10, 2018 at 10:23:12PM -0800, Elijah Newren wrote: > fast-export output is traditionally used as an input to a fast-import > program, but it is also useful to help gather statistics about the > history of a repository (particularly when --no-data is also passed). > For example, two of

Re: [PATCH 09/10] fast-export: add a --show-original-ids option to show original names

2018-11-10 Thread Jeff King
On Sat, Nov 10, 2018 at 10:23:11PM -0800, Elijah Newren wrote: > Knowing the original names (hashes) of commits, blobs, and tags can > sometimes enable post-filtering that would otherwise be difficult or > impossible. In particular, the desire to rewrite commit messages which > refer to other

Re: [PATCH 08/10] fast-export: add --reference-excluded-parents option

2018-11-10 Thread Jeff King
On Sat, Nov 10, 2018 at 10:23:10PM -0800, Elijah Newren wrote: > git filter-branch has a nifty feature allowing you to rewrite, e.g. just > the last 8 commits of a linear history > git filter-branch $OPTIONS HEAD~8..HEAD > > If you try the same with git fast-export, you instead get a history

Re: [PATCH 07/10] fast-export: ensure we export requested refs

2018-11-10 Thread Jeff King
On Sat, Nov 10, 2018 at 10:23:09PM -0800, Elijah Newren wrote: > If file paths are specified to fast-export and a ref points to a commit > that does not touch any of the relevant paths, then that ref would > sometimes fail to be exported. (This depends on whether any ancestors > of the commit

Re: [PATCH 06/10] fast-export: when using paths, avoid corrupt stream with non-existent mark

2018-11-10 Thread Jeff King
On Sat, Nov 10, 2018 at 10:23:08PM -0800, Elijah Newren wrote: > If file paths are specified to fast-export and multiple refs point to a > commit that does not touch any of the relevant file paths, then > fast-export can hit problems. fast-export has a list of additional refs > that it needs to

Re: [PATCH 05/10] fast-export: move commit rewriting logic into a function for reuse

2018-11-10 Thread Jeff King
On Sat, Nov 10, 2018 at 10:23:07PM -0800, Elijah Newren wrote: > Logic to replace a filtered commit with an unfiltered ancestor is useful > elsewhere; put it into a function we can call. OK. I had to stare at it for a minute to make sure there was not an edge case with looking at "p" versus

  1   2   3   4   5   6   7   8   9   10   >