* Re: [PATCH 0/5] Store submodules in a hash, not a linked list
From: Jeff King @ 2017-02-09 19:58 UTC (permalink / raw)
To: Michael Haggerty
Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy,
Stefan Beller, Johannes Schindelin, David Turner, git
In-Reply-To: <cover.1486629195.git.mhagger@alum.mit.edu>
On Thu, Feb 09, 2017 at 02:26:57PM +0100, Michael Haggerty wrote:
> I have mentioned this patch series on the mailing list a couple of
> time [1,2] but haven't submitted it before. I just rebased it to
> current master. It is available from my Git fork [3] as branch
> "submodule-hash".
>
> The first point of this patch series is to optimize submodule
> `ref_store` lookup by storing the `ref_store`s in a hashmap rather
> than a linked list. But a more interesting second point is to weaken
> the 1:1 relationship between submodules and `ref_stores` a little bit
> more.
Sounds good. I remember this had been discussed before due to
performance issues with resolve_gitlink_ref(), and we took a different
route (not populating non-submodule entries). I think it's nice to have
both optimizations, though, as they hit different use cases.
> A `files_ref_store` would be perfectly happy to represent, say, the
> references *physically* stored in a linked worktree (e.g., `HEAD`,
> `refs/bisect/*`, etc) even though that is not the complete collection
> of refs that are *logically* visible from that worktree (which
> includes references from the main repository, too). But the old code
> was confusing the two things by storing "submodule" in every
> `ref_store` instance.
>
> So push the submodule attribute down to the `files_ref_store` class
> (but continue to let the `ref_store`s be looked up by submodule).
I'm not sure I understand all of the ramifications here. It _sounds_ like
pushing this down into the files-backend code would make it harder to
have mixed ref-backends for different submodules. Or is this just
pushing down an implementation detail of the files backend, and future
code is free to have as many different ref_stores as it likes?
-Peff
^ permalink raw reply
* Re: What's cooking in git.git (Feb 2017, #02; Mon, 6)
From: Junio C Hamano @ 2017-02-09 19:24 UTC (permalink / raw)
To: Michael Haggerty; +Cc: git
In-Reply-To: <2f67fc21-92f9-a03e-1b09-a237af6dbc46@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
> On 02/06/2017 11:34 PM, Junio C Hamano wrote:
>> [...]
>> --------------------------------------------------
>> [Stalled]
>> [...]
>> * mh/ref-remove-empty-directory (2017-01-07) 23 commits
>> - files_transaction_commit(): clean up empty directories
>> - try_remove_empty_parents(): teach to remove parents of reflogs, too
>> - try_remove_empty_parents(): don't trash argument contents
>> - try_remove_empty_parents(): rename parameter "name" -> "refname"
>> - delete_ref_loose(): inline function
>> - delete_ref_loose(): derive loose reference path from lock
>> - log_ref_write_1(): inline function
>> - log_ref_setup(): manage the name of the reflog file internally
>> - log_ref_write_1(): don't depend on logfile argument
>> - log_ref_setup(): pass the open file descriptor back to the caller
>> - log_ref_setup(): improve robustness against races
>> - log_ref_setup(): separate code for create vs non-create
>> - log_ref_write(): inline function
>> - rename_tmp_log(): improve error reporting
>> - rename_tmp_log(): use raceproof_create_file()
>> - lock_ref_sha1_basic(): use raceproof_create_file()
>> - lock_ref_sha1_basic(): inline constant
>> - raceproof_create_file(): new function
>> - safe_create_leading_directories(): set errno on SCLD_EXISTS
>> - safe_create_leading_directories_const(): preserve errno
>> - t5505: use "for-each-ref" to test for the non-existence of references
>> - refname_is_safe(): correct docstring
>> - files_rename_ref(): tidy up whitespace
>>
>> Deletion of a branch "foo/bar" could remove .git/refs/heads/foo
>> once there no longer is any other branch whose name begins with
>> "foo/", but we didn't do so so far. Now we do.
>>
>> Expecting a reroll.
>> cf. <5051c78e-51f9-becd-e1a6-9c0b781d6912@alum.mit.edu>
>
> I think you missed v4 of this patch series [1], which is the re-roll
> that you were waiting for. And I missed that you missed it...
>
> Michael
>
> [1] http://public-inbox.org/git/cover.1483719289.git.mhagger@alum.mit.edu/
Actually it was worse than that. What the above lists *is* v4; I
just failed to update "Expecting a reroll" note when I updated the
topic with your rerolled patches, and left it there trusting the
now-stale note of mine.
Sorry, and a HUGE thanks for noticing the mistake.
^ permalink raw reply
* Re: What's cooking in git.git (Feb 2017, #02; Mon, 6)
From: Johannes Schindelin @ 2017-02-09 20:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <xmqqfujns2li.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Thu, 9 Feb 2017, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > (And that would have to be handled at a different point, as I had
> > pointed out, so that suggested preparation would most likely not help
> > at all.)
>
> I did not think "that would have to be handled at a different point"
> is correct at all, if by "a point" you meant "a location in the
> code" [*1*].
Yes, I mean the location in the code.
But since you keep insisting that you are right and I am wrong, and even
go so far as calling your patch reverting my refactoring a hot-fix, why
don't you just go ahead and merge the result over my objections?
Ciao,
Johannes
^ permalink raw reply
* gitk bug: file select in the tree mode
From: Anatoly Borodin @ 2017-02-09 20:44 UTC (permalink / raw)
To: git
Hi All!
There is a bug in gitk (e.g. 2.11.0):
1) Choose a repository with files in a subdir (git's repo for example).
2) `cd` to a subdir (e.g. `xdiff`).
3) Run `gitk`.
4) Select 'Tree' in the 'Patch / Tree' panel.
5) Select any file with 'Highlight this too' or 'Highlight this only'
(e.g `xmerge.c`).
6) See the short file name (`xmerge.c`) instead of the full path
(`xdiff/xmerge.c`) in the 'Find commit touching path:' edit field. No
commits touching the file can be found.
--
Mit freundlichen Grüßen,
Anatoly Borodin
^ permalink raw reply
* Re: Bug with fixup and autosquash
From: Johannes Schindelin @ 2017-02-09 20:55 UTC (permalink / raw)
To: Junio C Hamano
Cc: Ashutosh Bapat, git, Michael Haggerty, Michael J Gruber,
Matthieu Moy
In-Reply-To: <xmqqbmucuwb0.fsf@gitster.mtv.corp.google.com>
Hi Ashutosh and Junio,
On Wed, 8 Feb 2017, Junio C Hamano wrote:
> Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> writes:
>
> > I have been using git rebase heavily these days and seem to have found
> > a bug.
> >
> > If there are two commit messages which have same prefix e.g.
> > yyyyyy This is prefix
> > xxxxxx This is prefix and message
> >
> > xxxxxx comitted before yyyyyy
> >
> > Now I commit a fixup to yyyyyy using git commit --fixup yyyyyy
> > zzzzzz fixup! This is prefix
> >
> > When I run git rebase -i --autosquash, the script it shows me looks like
> > pick xxxxxx This is prefix and message
> > fixup zzzzzz fixup! This is prefix
> > pick yyyyyy This is prefix
> >
> > I think the correct order is
> > pick xxxxxx This is prefix and message
> > pick yyyyyy This is prefix
> > fixup zzzzzz fixup! This is prefix
> >
> > Is that right?
>
> [...]
>
> Unfortunately, "rebase -i --autosquash" reorders the entries by
> identifying the commit by its title, and it goes with prefix match so
> that fix-up commits created without using --fixup option but manually
> records the title's prefix substring can also work.
This prefix match also happens to introduce a serious performance problem,
which is why I "fixed" this issue in the rebase--helper already (which is
the case if you are using Git for Windows, whose master branch builds on
Linux and MacOSX as well). I quoted "fix" because my motivation was to fix
the performance problem, not the "incorrect match" problem.
The rebase--helper code (specifically, the patch moving autosquash logic
into it: https://github.com/dscho/git/commit/7d0831637f) tries to match
exact onelines first, and falls back to prefix matching only after that.
Now that the sequencer-i patch series is in `master`, the next step is to
send the patch series introducing the rebase--helper. The patch series
including the fix discussed above relies on that one. Meaning that it will
take a while to get through the mill.
So please do not hold your breath until this feature/fix hits an official
Git version. If you need it[*1*] faster, feel free to build Git for
Windows' master and run with that for a while.
Ciao,
Johannes
Footnote: By "it" I mean "the feature/fix", not "an official Git version"
nor "your breath".
^ permalink raw reply
* Re: [PATCH 2/5] refs: push the submodule attribute down
From: Junio C Hamano @ 2017-02-09 21:07 UTC (permalink / raw)
To: Michael Haggerty
Cc: Nguyễn Thái Ngọc Duy, Stefan Beller,
Johannes Schindelin, David Turner, git
In-Reply-To: <8958e7e26cc8bf11a76672eb8ea98bc9ba662fdc.1486629195.git.mhagger@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
> Push the submodule attribute down from ref_store to files_ref_store.
> This is another step towards loosening the 1:1 connection between
> ref_stores and submodules.
The update seems to retain the externally visible effects, but what
does this change mean for future backend writers whose code will sit
next to files_ref_store? They need to have "submodule" field in their
implementation of the backend and keep track of it?
Granted that the primary thing that looks at ->submodule field in
the code before this change all live in refs/files-backend.c, but I
am not sure if that is an artifact of us having only one backend at
this moment, or a sign that future backends would benefit from extra
freedom to choose how they exactly implement their submodule
support.
^ permalink raw reply
* Re: [PATCH 3/5] register_ref_store(): new function
From: Junio C Hamano @ 2017-02-09 21:16 UTC (permalink / raw)
To: Michael Haggerty
Cc: Nguyễn Thái Ngọc Duy, Stefan Beller,
Johannes Schindelin, David Turner, git
In-Reply-To: <ce326e17822184eff434b957d28f2233795162db.1486629195.git.mhagger@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
> Move the responsibility for registering the ref_store for a submodule
> from base_ref_store_init() to a new function, register_ref_store(). Call
> the latter from ref_store_init().
>
> This means that base_ref_store_init() can lose its submodule argument,
> further weakening the 1:1 relationship between ref_stores and
> submodules.
OK. I think I am starting to get it. I've always found it
disturbing that for_each_*ref*() has a "submodule" variant.
Instead, the plan (outlined in the discussion from yesterday that
triggered your posting this series) is to give an API to request a
"ref-store", and then ask that object to iterate over refs, and
these steps get us closer to that goal, because the "to enumerate
these" won't have to know what set of refs a ref-store contains. If
you want to iterate over refs in a submodule, you grab a ref-store
for the submodule and ask it to iterate. Iterating over refs in
another worktree, you grab a different ref-store and ask it to
iterate using the same API.
Sounds like a good direction to go.
^ permalink raw reply
* Re: [PATCH] rev-parse --git-path: fix output when running in a subdirectory
From: Johannes Schindelin @ 2017-02-09 21:11 UTC (permalink / raw)
To: Mike Rappazzo
Cc: Duy Nguyen, Git Mailing List, Junio C Hamano, SZEDER Gábor
In-Reply-To: <CANoM8SWv+KD92T263gS0Uxxi2ekNQdo0aNGx3AmweVasXk3GbA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1603 bytes --]
Hi Mike,
On Thu, 9 Feb 2017, Mike Rappazzo wrote:
> On Thu, Feb 9, 2017 at 4:48 AM, Duy Nguyen <pclouds@gmail.com> wrote:
>
> > Relevant thread in the past [1] which fixes both --git-path and
> > --git-common-dir. I think the author dropped it somehow (or forgot
> > about it, I know I did). Sorry can't comment on that thread, or this
> > patch, yet.
>
> I didn't exactly forget it (I have it sitting in a branch), I wasn't
> sure what else was needed (from a v5 I guess), so it has stagnated.
>
> There was also another patch [1] at the time done by SZEDER Gábor trying
> to speed up the completion scripts by adding `git rev-parse
> --absolute-git-dir` option to deal with this case as well.
>
> > [1] http://public-inbox.org/git/1464261556-89722-1-git-send-email-rappazzo@gmail.com/
>
> [1] http://public-inbox.org/git/20170203024829.8071-16-szeder.dev@gmail.com/
Ah, so I was not the only person reporting this bug, but I am seemingly
having as much luck getting a fix in.
I had a quick look at your v4:
http://public-inbox.org/git/1464261556-89722-3-git-send-email-rappazzo@gmail.com/
It seems you replaced the git_path() by a combination of git_dir() and
relative_path(), but that would break the use case where git_path()
handles certain arguments specially, e.g. "objects" which knows that the
.git/objects/ path can be overridden via the environment.
I tried very hard to keep that working in my patch, essentially by
emulating what git_path() does already when being called in a worktree's
subdirectory: make the path absolute.
Ciao,
Johannes
^ permalink raw reply
* Re: [PATCH 4/5] files_ref_store::submodule: use NULL for the main repository
From: Junio C Hamano @ 2017-02-09 21:19 UTC (permalink / raw)
To: Michael Haggerty
Cc: Nguyễn Thái Ngọc Duy, Stefan Beller,
Johannes Schindelin, David Turner, git
In-Reply-To: <111d663c0fd3e9669e7c28537f581833488ca4a6.1486629195.git.mhagger@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
> The old practice of storing the empty string in this member for the main
> repository was a holdover from before 00eebe3 (refs: create a base class
> "ref_store" for files_ref_store, 2016-09-04), when the submodule was
> stored in a flex array at the end of `struct files_ref_store`. Storing
> NULL for this case is more idiomatic and a tiny bit less code.
Yes. I noticed this bit in 3/5 and wondered about it, knowing this
step comes next:
> struct ref_store *ref_store_init(const char *submodule)
> {
> const char *be_name = "files";
> struct ref_storage_be *be = find_ref_storage_backend(be_name);
> + struct ref_store *refs;
>
> if (!be)
> die("BUG: reference backend %s is unknown", be_name);
>
> if (!submodule || !*submodule)
> - return be->init(NULL);
> + refs = be->init(NULL);
> else
> - return be->init(submodule);
> + refs = be->init(submodule);
Can't we also lose this "if !*submodule, turn it to NULL"?
> --- a/refs/files-backend.c
> +++ b/refs/files-backend.c
> @@ -980,7 +980,7 @@ static struct ref_store *files_ref_store_create(const char *submodule)
> struct files_ref_store *refs = xcalloc(1, sizeof(*refs));
> struct ref_store *ref_store = (struct ref_store *)refs;
>
> - base_ref_store_init(ref_store, &refs_be_files, submodule);
> + base_ref_store_init(ref_store, &refs_be_files);
>
> refs->submodule = submodule ? xstrdup(submodule) : "";
Also, can't we use xstrdup_or_null(submodule) with this step?
^ permalink raw reply
* Re: [PATCH 0/5] Store submodules in a hash, not a linked list
From: Michael Haggerty @ 2017-02-09 21:23 UTC (permalink / raw)
To: Jeff King
Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy,
Stefan Beller, Johannes Schindelin, David Turner, git
In-Reply-To: <20170209195812.dbbmko4sas3wtdy5@sigill.intra.peff.net>
On 02/09/2017 08:58 PM, Jeff King wrote:
> On Thu, Feb 09, 2017 at 02:26:57PM +0100, Michael Haggerty wrote:
> [...]
>> A `files_ref_store` would be perfectly happy to represent, say, the
>> references *physically* stored in a linked worktree (e.g., `HEAD`,
>> `refs/bisect/*`, etc) even though that is not the complete collection
>> of refs that are *logically* visible from that worktree (which
>> includes references from the main repository, too). But the old code
>> was confusing the two things by storing "submodule" in every
>> `ref_store` instance.
>>
>> So push the submodule attribute down to the `files_ref_store` class
>> (but continue to let the `ref_store`s be looked up by submodule).
>
> I'm not sure I understand all of the ramifications here. It _sounds_ like
> pushing this down into the files-backend code would make it harder to
> have mixed ref-backends for different submodules. Or is this just
> pushing down an implementation detail of the files backend, and future
> code is free to have as many different ref_stores as it likes?
I don't understand how this would make it harder, aside from the fact
that a new backend class might also need a path member and have to
maintain its own copy rather than using one that the base class provides.
I consider it an implementation detail of the files backend that it
needs to keep a permanent record of its submodule path in
files_ref_store. Some hypothetical future backend might instead need,
say, an IP number and port to connect to a MySQL server. A hypothetical
pure packed-refs backend might just store the path of the packed-refs file.
A more likely imminent change is that backends need a path, but that the
path needn't correspond to the git_dir of the repository that contains
the corresponding objects, for example in the case of a linked worktree.
You might ask for the ref_store for a worktree-submodule, and end up
getting a compound object that delegates to one ref_store pointing at
its git_dir and one at its common_dir.
Michael
^ permalink raw reply
* Re: [PATCH] rev-parse --git-path: fix output when running in a subdirectory
From: Junio C Hamano @ 2017-02-09 21:33 UTC (permalink / raw)
To: Duy Nguyen; +Cc: Johannes Schindelin, Git Mailing List
In-Reply-To: <CACsJy8CigsWjAq5cmJ=cbBmj=DdJtHdMKxmoifftuz9+9kqJiQ@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
> Relevant thread in the past [1] which fixes both --git-path and
> --git-common-dir. I think the author dropped it somehow (or forgot
> about it, I know I did). Sorry can't comment on that thread, or this
> patch, yet.
>
> [1] http://public-inbox.org/git/1464261556-89722-1-git-send-email-rappazzo@gmail.com/
Thanks for a pointer. I see Mike responded to this message (I
haven't had a chance to read and think about it yet), so I trust
that you three can figure out if these are the same issues and what
the final solution in the longer term should be.
I have no strong opinion for or against a "longer term" solution
that makes "rev-parse --git-path" behave differently from how it
behaves today, but I am not yet convinced that we can reach that
longer term goal without a transition period, as I suspect there are
existing users that know and came to expect how it behaves, based on
its today's behaviour. Other than that I do not have suggestion on
this topic at the moment.
Thanks.
^ permalink raw reply
* Re: [PATCH 4/5] files_ref_store::submodule: use NULL for the main repository
From: Stefan Beller @ 2017-02-09 21:36 UTC (permalink / raw)
To: Junio C Hamano
Cc: Michael Haggerty, Nguyễn Thái Ngọc Duy,
Johannes Schindelin, David Turner, git@vger.kernel.org
In-Reply-To: <xmqq1sv7oyei.fsf@gitster.mtv.corp.google.com>
On Thu, Feb 9, 2017 at 1:19 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> if (!submodule || !*submodule)
>> - return be->init(NULL);
>> + refs = be->init(NULL);
>> else
>> - return be->init(submodule);
>> + refs = be->init(submodule);
>
> Can't we also lose this "if !*submodule, turn it to NULL"?
That was my suggestion as well, but that did not look nicer per se.
That is because at this point of the series we still handle "" just fine.
>> refs->submodule = submodule ? xstrdup(submodule) : "";
>
> Also, can't we use xstrdup_or_null(submodule) with this step?
>
That is done in 4/5; here we must keep a "" around instead of NULL IIUC.
^ permalink raw reply
* Re: [PATCH] rev-parse --git-path: fix output when running in a subdirectory
From: Johannes Schindelin @ 2017-02-09 21:05 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Nguyễn Thái Ngọc Duy
In-Reply-To: <xmqqh944wmcs.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Wed, 8 Feb 2017, Junio C Hamano wrote:
> How long has "rev-parse --git-path" been around? Had scripts in the
> wild chance to learn to live with the "output is relative to the top of
> the working tree" reality? I think the answers are "since 2.5" and
> "yes".
Correct. And the third question is: How did the scripts work around this
feature?
The answer is obvious: by switching back to `$(git rev-parse
--git-dir)/filename`.
This is literally on what I spent the better part of Wednesday.
There is just no way you can "fix" this otherwise. As an occasional shell
scripter, you may be tempted to use `$(git rev-parse --show-cdup)$(git
rev-parse --git-path filename)`, but of course that breaks in worktrees
and if you do not use worktrees you would not even know that your
workaround introduced another bug.
The current handling of --git-path is just plain wrong. The fact that I am
the first person to report this here merely shows how much it is used in
the wild.
Ciao,
Johannes
^ permalink raw reply
* Re: GSoC 2017: application open, deadline = February 9, 2017
From: Johannes Schindelin @ 2017-02-09 21:38 UTC (permalink / raw)
To: Christian Couder
Cc: Matthieu Moy, Jeff King, git, Pranit Bauva, Lars Schneider,
Carlos Martín Nieto, Thomas Gummerer, Siddharth Kannan
In-Reply-To: <CAP8UFD3aygSf5U2abnpCfRzEf-hH5fSNuzFBBtgCjSQC3F8c5A@mail.gmail.com>
Hi Christian,
On Thu, 9 Feb 2017, Christian Couder wrote:
> I just had a look and the microproject and idea pages for this year are
> ok. They are not great sure, but not much worse than the previous
> years. What should probably be done is to remove project ideas where is
> no "possible mentor" listed.
>
> But I am reluctant to do that as I don't know what Dscho would be ok to
> mentor.
I am okay to mentor (except anything that touches submodules).
Ciao,
Johannes
^ permalink raw reply
* Re: [PATCH] rev-parse --git-path: fix output when running in a subdirectory
From: Junio C Hamano @ 2017-02-09 21:50 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, Nguyễn Thái Ngọc Duy
In-Reply-To: <alpine.DEB.2.20.1702092201080.3496@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> On Wed, 8 Feb 2017, Junio C Hamano wrote:
>
>> How long has "rev-parse --git-path" been around? Had scripts in the
>> wild chance to learn to live with the "output is relative to the top of
>> the working tree" reality? I think the answers are "since 2.5" and
>> "yes".
>
> Correct. And the third question is: How did the scripts work around this
> feature?
>
> The answer is obvious: by switching back to `$(git rev-parse
> --git-dir)/filename`.
>
> This is literally on what I spent the better part of Wednesday.
>
> There is just no way you can "fix" this otherwise. As an occasional shell
> scripter, you may be tempted to use `$(git rev-parse --show-cdup)$(git
> rev-parse --git-path filename)`, but of course that breaks in worktrees
> and if you do not use worktrees you would not even know that your
> workaround introduced another bug.
In case it is not clear, I understand all of the above.
I was just worried about the people who do *NOT* use worktrees and
did the obvious "concatenate --cdup with --git-path" and thought
their script were working happily and well. By prepending the path
to the (real) location of the .git in the updated --git-path output
ourselves, they will complain, our update broke their script.
If we introduced the fix gently, by (1) warn when "--git-path" is
used but give the current output anyway, while adding the "fixed"
one as another new option, and then (2) remove "--git-path" after
several releases, they will not have to complain, even though they
will see warning until they stop using "--git-path".
There may be gentler alternative ways to transition, and I do not
worry about the specifics of them too much. I just think we cannot
do this in a single step without harming existing users.
^ permalink raw reply
* Re: Bug with fixup and autosquash
From: Junio C Hamano @ 2017-02-09 21:21 UTC (permalink / raw)
To: Johannes Schindelin
Cc: Ashutosh Bapat, git, Michael Haggerty, Michael J Gruber,
Matthieu Moy
In-Reply-To: <alpine.DEB.2.20.1702092142020.3496@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> This prefix match also happens to introduce a serious performance problem,
> which is why I "fixed" this issue in the rebase--helper already (which is
> the case if you are using Git for Windows, whose master branch builds on
> Linux and MacOSX as well). I quoted "fix" because my motivation was to fix
> the performance problem, not the "incorrect match" problem.
In other words, regardless of your motivation, you "fix"ed both,
which is very nice ;-)
^ permalink raw reply
* Re: GSoC 2017: application open, deadline = February 9, 2017
From: Stefan Beller @ 2017-02-09 21:47 UTC (permalink / raw)
To: Johannes Schindelin
Cc: Christian Couder, Matthieu Moy, Jeff King, git, Pranit Bauva,
Lars Schneider, Carlos Martín Nieto, Thomas Gummerer,
Siddharth Kannan
In-Reply-To: <alpine.DEB.2.20.1702092236500.3496@virtualbox>
On Thu, Feb 9, 2017 at 1:38 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi Christian,
>
> On Thu, 9 Feb 2017, Christian Couder wrote:
>
>> I just had a look and the microproject and idea pages for this year are
>> ok. They are not great sure, but not much worse than the previous
>> years. What should probably be done is to remove project ideas where is
>> no "possible mentor" listed.
>>
>> But I am reluctant to do that as I don't know what Dscho would be ok to
>> mentor.
>
> I am okay to mentor (except anything that touches submodules).
I am okay to mentor anything (preferrably submodules).
Thanks,
Stefan
>
> Ciao,
> Johannes
^ permalink raw reply
* Re: What's cooking in git.git (Feb 2017, #02; Mon, 6)
From: Junio C Hamano @ 2017-02-09 22:02 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.2.20.1702092135050.3496@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> > (And that would have to be handled at a different point, as I had
>> > pointed out, so that suggested preparation would most likely not help
>> > at all.)
>>
>> I did not think "that would have to be handled at a different point"
>> is correct at all, if by "a point" you meant "a location in the
>> code" [*1*].
>
> Yes, I mean the location in the code.
>
> But since you keep insisting that you are right and I am wrong,...
There is no "insisting". Didn't we just see how wrong you were
about "different point"? An extended syntax of override would be
handled in the new helper to handle override, the same point in the
code as other overrides are handled.
> ... and even
> go so far as calling your patch reverting my refactoring a hot-fix, why
> don't you just go ahead and merge the result over my objections?
At this point, you are simply being silly.
Isn't "Putty is not a command but is also handled as if it is a
valid implementation of SSH" a bug? Isn't making the code not to be
confused like so a fix?
A different approach to fix the issue would be to declare that the
command names and overrides are not in separate namespaces.
If you prefer to go that route, the documentation can use an update
to make it not mention "putty" as a valid override (the users have
to spell "plink"), mention "plink.exe" is also accepted, etc. and
make it clear that the override environment and configuration
variables are the way to tell Git: "The ssh implementation I have
behaves the same way as this well-known implementation, so treat it
as such without actually looking at the path to the command in the
ssh.command string".
That may limit the freedom for future enhancement of overrides, but
is an acceptable short-cut. After all, the overrides are merely an
escape hatch and we expect them to be used only rarely.
^ permalink raw reply
* Re: Bug with fixup and autosquash
From: Johannes Schindelin @ 2017-02-09 22:02 UTC (permalink / raw)
To: Junio C Hamano
Cc: Ashutosh Bapat, git, Michael Haggerty, Michael J Gruber,
Matthieu Moy
In-Reply-To: <xmqqwpcznjqi.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Thu, 9 Feb 2017, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > This prefix match also happens to introduce a serious performance problem,
> > which is why I "fixed" this issue in the rebase--helper already (which is
> > the case if you are using Git for Windows, whose master branch builds on
> > Linux and MacOSX as well). I quoted "fix" because my motivation was to fix
> > the performance problem, not the "incorrect match" problem.
>
> In other words, regardless of your motivation, you "fix"ed both,
> which is very nice ;-)
Almost. While I fixed the performance issues as well as the design
allowed, I happened to "fix" the problem where an incomplete prefix match
could be favored over an exact match.
I really fixed the performance issues. Not "fixed" them.
Ciao,
Johannes
^ permalink raw reply
* Re: Cross-referencing the Git mailing list archive with their corresponding commits in `pu`
From: Johannes Schindelin @ 2017-02-09 21:53 UTC (permalink / raw)
To: Lars Schneider; +Cc: Junio C Hamano, Josh Triplett, git
In-Reply-To: <3F7E4C9E-593E-4FC5-B820-E6A0CDEB7476@gmail.com>
Hi Lars,
On Thu, 9 Feb 2017, Lars Schneider wrote:
> > On 06 Feb 2017, at 20:10, Junio C Hamano <gitster@pobox.com> wrote:
> >
> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> >
> >> So I thought maybe the From: line (from the body, if available,
> >> otherwise from the header) in conjunction with the "Date:" header
> >> would work.
> >
> > FYI, I use a post-applypatch hook to populate refs/notes/amlog notes
> > tree when I queue a new patch; I am not sure how well the notes in it
> > are preserved across rebases, but it could be a good starting point.
> > The notes tree is mirrored at git://github.com/git/gitster repository.
> >
> > E.g.
> >
> > $ git show --notes=amlog --stat
>
> That's super useful! Thanks for the pointer!
> Wouldn't it make sense to push these notes to github.com/git/git ?
I am not quite sure about that. It is in a different namespace than what
is usually cloned, and it currently adds 8MB to the download (there are
"amlog" and "commits", the latter clearly being a sandbox).
While I am thankful that there is at least some information available for
patches integrated into `pu` since Nov 1 2016, the format is probably not
stable (we are talking about free-form notes, after all), and it still
does not help with catching the case where new patch series iterations (or
in some case, new patch series, period) are missed.
Make no mistake, it will be a huge undertaking to develop a tool that
helps with the management of patch series on top of the mailing list
driven patch review process. And even in the best case, it may be simply
too hard for an automated tool to figure things out e.g. when Peff or
Junio paste a tangentially related diff into a thread.
In the end, what I *really* would love to have is a system where you can
easily query "which reviewer comments on *any* of my patch series are new,
or still unaddressed?", and "in what way was my patch modified relative to
the latest version I submitted?". It may actually be impossible to create
such a tool, as it cannot invent information/cross-references that it does
not have nor can deduce from available data.
Ciao,
Johannes
^ permalink raw reply
* Re: Cross-referencing the Git mailing list archive with their corresponding commits in `pu`
From: Junio C Hamano @ 2017-02-09 22:18 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Lars Schneider, Josh Triplett, git
In-Reply-To: <alpine.DEB.2.20.1702092242120.3496@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> > E.g.
>> >
>> > $ git show --notes=amlog --stat
>>
>> That's super useful! Thanks for the pointer!
>> Wouldn't it make sense to push these notes to github.com/git/git ?
>
> I am not quite sure about that. It is in a different namespace than what
> is usually cloned, and it currently adds 8MB to the download (there are
> "amlog" and "commits", the latter clearly being a sandbox).
I do not think the public mirrors of the primary repository should
get amlog, either. It is more suited for those who are interested
in broken-out topics, i.e. git://github.com/git/gitster.
^ permalink raw reply
* Re: [PATCH] rev-parse --git-path: fix output when running in a subdirectory
From: Johannes Schindelin @ 2017-02-09 22:11 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Duy Nguyen, Git Mailing List
In-Reply-To: <xmqqshnnnj6q.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Thu, 9 Feb 2017, Junio C Hamano wrote:
> Duy Nguyen <pclouds@gmail.com> writes:
>
> > Relevant thread in the past [1] which fixes both --git-path and
> > --git-common-dir. I think the author dropped it somehow (or forgot
> > about it, I know I did). Sorry can't comment on that thread, or this
> > patch, yet.
> >
> > [1] http://public-inbox.org/git/1464261556-89722-1-git-send-email-rappazzo@gmail.com/
>
> Thanks for a pointer. I see Mike responded to this message (I
> haven't had a chance to read and think about it yet), so I trust
> that you three can figure out if these are the same issues and what
> the final solution in the longer term should be.
>
> I have no strong opinion for or against a "longer term" solution
> that makes "rev-parse --git-path" behave differently from how it
> behaves today, but I am not yet convinced that we can reach that
> longer term goal without a transition period, as I suspect there are
> existing users that know and came to expect how it behaves, based on
> its today's behaviour. Other than that I do not have suggestion on
> this topic at the moment.
Given that
- the output is incorrect, not some output that could maybe be improved,
- warnings in a script execution are most likely to be missed,
- --git-path gives incorrect output in subdirectories, except inside
worktrees, therefore scripts relying on the current behavior are highly
likely to misbehave in worktrees anyway,
- leaving this bug unfixed even when we know about it for 3 major releases
reflects really badly on Git as a project, and
- the longer we wait to fix this bug, the more developers will simply stay
away from --git-path (of course, only *after* they were bitten by the
bug, like I was),
it should be safe to assume that a transitional period is more likely to
do more harm to our users than bring benefit.
Ciao,
Johannes
^ permalink raw reply
* Re: Bug with fixup and autosquash
From: Junio C Hamano @ 2017-02-09 22:16 UTC (permalink / raw)
To: Johannes Schindelin
Cc: Ashutosh Bapat, git, Michael Haggerty, Michael J Gruber,
Matthieu Moy
In-Reply-To: <alpine.DEB.2.20.1702092301070.3496@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Almost. While I fixed the performance issues as well as the design
> allowed, I happened to "fix" the problem where an incomplete prefix match
> could be favored over an exact match.
Hmph. Would it require too much further work to do what you said
the code does:
> The rebase--helper code (specifically, the patch moving autosquash logic
> into it: https://github.com/dscho/git/commit/7d0831637f) tries to match
> exact onelines first, and falls back to prefix matching only after that.
If the code matches exact onlines and then falls back to prefix, I
do not think incomplete prefix would be mistakenly chosen over an
exact one, so perhaps your code already does the right thing?
^ permalink raw reply
* Re: [PATCH 1/5] refs: store submodule ref stores in a hashmap
From: Junio C Hamano @ 2017-02-09 20:34 UTC (permalink / raw)
To: Michael Haggerty
Cc: Nguyễn Thái Ngọc Duy, Stefan Beller,
Johannes Schindelin, David Turner, git
In-Reply-To: <a944446c4c374125082f5ad8b79e731704b66196.1486629195.git.mhagger@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
> Aside from scaling better, this means that the submodule name needn't be
> stored in the ref_store instance anymore (which will be changed in a
> moment).
Nice. I like the latter reason very much (this is not a suggestion
to change the description).
> +struct submodule_hash_entry
> +{
> + struct hashmap_entry ent; /* must be the first member! */
> +
> + struct ref_store *refs;
> +
> + /* NUL-terminated name of submodule: */
> + char submodule[FLEX_ARRAY];
> +};
> +
> +static int submodule_hash_cmp(const void *entry, const void *entry_or_key,
> + const void *keydata)
> +{
> + const struct submodule_hash_entry *e1 = entry, *e2 = entry_or_key;
> + const char *submodule = keydata;
> +
> + return strcmp(e1->submodule, submodule ? submodule : e2->submodule);
I would have found it more readable if it were like so:
const char *submodule = keydata ? keydata : e2->submodule;
return strcmp(e1->submodule, submodule);
but I suspect the difference is not that huge.
> +}
> +
> +static struct submodule_hash_entry *alloc_submodule_hash_entry(
> + const char *submodule, struct ref_store *refs)
> +{
> + size_t len = strlen(submodule);
> + struct submodule_hash_entry *entry = malloc(sizeof(*entry) + len + 1);
I think this (and the later memcpy) is what FLEX_ALLOC_MEM() was
invented for.
> + hashmap_entry_init(entry, strhash(submodule));
> + entry->refs = refs;
> + memcpy(entry->submodule, submodule, len + 1);
> + return entry;
> +}
> ...
> @@ -1373,16 +1405,17 @@ void base_ref_store_init(struct ref_store *refs,
> die("BUG: main_ref_store initialized twice");
>
> refs->submodule = "";
> - refs->next = NULL;
> main_ref_store = refs;
> } else {
> - if (lookup_ref_store(submodule))
> + refs->submodule = xstrdup(submodule);
> +
> + if (!submodule_ref_stores.tablesize)
> + hashmap_init(&submodule_ref_stores, submodule_hash_cmp, 20);
Makes me wonder what "20" stands for. Perhaps the caller should be
allowed to say "I do not quite care what initial size is" by passing
0 or some equally but more clealy meaningless value (which of course
would be outside the scope of this series).
^ permalink raw reply
* [PATCH v2 2/2] rebase -i: use the rebase--helper builtin
From: Johannes Schindelin @ 2017-02-09 22:23 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
In-Reply-To: <cover.1486678952.git.johannes.schindelin@gmx.de>
Now that the sequencer learned to process a "normal" interactive rebase,
we use it. The original shell script is still used for "non-normal"
interactive rebases, i.e. when --root or --preserve-merges was passed.
Please note that the --root option (via the $squash_onto variable) needs
special handling only for the very first command, hence it is still okay
to use the helper upon continue/skip.
Also please note that the --no-ff setting is volatile, i.e. when the
interactive rebase is interrupted at any stage, there is no record of
it. Therefore, we have to pass it from the shell script to the
rebase--helper.
Note: the test t3404 had to be adjusted because the the error messages
produced by the sequencer comply with our current convention to start with
a lower-case letter.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
git-rebase--interactive.sh | 13 +++++++++++++
t/t3404-rebase-interactive.sh | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 4734094a3f..2c9c0165b5 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -1069,6 +1069,10 @@ git_rebase__interactive () {
case "$action" in
continue)
+ if test ! -d "$rewritten"
+ then
+ exec git rebase--helper ${force_rebase:+--no-ff} --continue
+ fi
# do we have anything to commit?
if git diff-index --cached --quiet HEAD --
then
@@ -1128,6 +1132,10 @@ first and then run 'git rebase --continue' again.")"
skip)
git rerere clear
+ if test ! -d "$rewritten"
+ then
+ exec git rebase--helper ${force_rebase:+--no-ff} --continue
+ fi
do_rest
return 0
;;
@@ -1314,6 +1322,11 @@ expand_todo_ids
test -d "$rewritten" || test -n "$force_rebase" || skip_unnecessary_picks
checkout_onto
+if test -z "$rebase_root" && test ! -d "$rewritten"
+then
+ require_clean_work_tree "rebase"
+ exec git rebase--helper ${force_rebase:+--no-ff} --continue
+fi
do_rest
}
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index e2f18d11f6..33d392ba11 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -556,7 +556,7 @@ test_expect_success 'clean error after failed "exec"' '
echo "edited again" > file7 &&
git add file7 &&
test_must_fail git rebase --continue 2>error &&
- test_i18ngrep "You have staged changes in your working tree." error
+ test_i18ngrep "you have staged changes in your working tree" error
'
test_expect_success 'rebase a detached HEAD' '
--
2.11.1.windows.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox