* Re: [PATCH v4 05/14] i18n: add--interactive: mark plural strings
From: Junio C Hamano @ 2016-10-19 18:40 UTC (permalink / raw)
To: Vasco Almeida
Cc: git, Jiang Xin, Ævar Arnfjörð Bjarmason,
Jean-Noël AVILA, Jakub Narębski, David Aguilar
In-Reply-To: <20161010125449.7929-6-vascomalmeida@sapo.pt>
Vasco Almeida <vascomalmeida@sapo.pt> writes:
> @@ -669,12 +669,18 @@ sub status_cmd {
> sub say_n_paths {
> my $did = shift @_;
> my $cnt = scalar @_;
> - print "$did ";
> - if (1 < $cnt) {
> - print "$cnt paths\n";
> - }
> - else {
> - print "one path\n";
> + if ($did eq 'added') {
> + printf(__n("added %d path\n", "added %d paths\n",
> + $cnt), $cnt);
> + } elsif ($did eq 'updated') {
> + printf(__n("updated %d path\n", "updated %d paths\n",
> + $cnt), $cnt);
> + } elsif ($did eq 'reverted') {
> + printf(__n("reverted %d path\n", "reverted %d paths\n",
> + $cnt), $cnt);
> + } else {
> + printf(__n("touched %d path\n", "touched %d paths\n",
> + $cnt), $cnt);
> }
> }
Nice to see you covered all verbs currently in use and then
future-proofed by adding a fallback "touched" here.
Thanks.
^ permalink raw reply
* Re: [PATCH v4 01/14] i18n: add--interactive: mark strings for translation
From: Junio C Hamano @ 2016-10-19 18:14 UTC (permalink / raw)
To: Vasco Almeida
Cc: git, Jiang Xin, Ævar Arnfjörð Bjarmason,
Jean-Noël AVILA, Jakub Narębski, David Aguilar
In-Reply-To: <20161010125449.7929-2-vascomalmeida@sapo.pt>
Vasco Almeida <vascomalmeida@sapo.pt> writes:
> } else {
> - print "No untracked files.\n";
> + print __("No untracked files.\n");
> }
Not a big deal, but this makes me wonder if we want to do this
instead
print __("No untracked files.") . "\n";
so that translators do not have to remember to keep the final LF.
It seems there are some more hits of strings that end with "\n"
inside __(...) in this patch, so it probably is OK.
^ permalink raw reply
* Re: [PATCH v3 5/6] trailer: allow non-trailers in trailer block
From: Jonathan Tan @ 2016-10-19 18:00 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Stefan Beller, git@vger.kernel.org, Jakub Narębski
In-Reply-To: <xmqqbmyhr4vt.fsf@gitster.mtv.corp.google.com>
On 10/18/2016 09:36 AM, Junio C Hamano wrote:
> Jonathan Tan <jonathantanmy@google.com> writes:
>
>>> * rs/c-auto-resets-attributes:
>>> pretty: avoid adding reset for %C(auto) if output is empty
>>>
>>> And neither of the two colon containing line remotely resembles how
>>> a typical RFC-822 header is formatted. So that may serve as a hint
>>> to how we can tighten it without introducing false negative.
>>
>> The only "offending" character is the space (according to RFC 822),
>> but that sounds like a good rule to have.
>
> I suspect that we should be willing to deviate from the letter of
> RFC to reject misidentification. I saw things like
>
> Thanks to: Jonathan Tan <jt@host.xz>
> Signed-off-by: A U Thor <au@th.or>
>
> in the wild (notice the SP between Thanks and to), for example.
> Rejecting leading whitespace as a line that does *not* start the
> header (hence its colon does not count) may be a good compromise.
Good point.
>> I think that "Signed-off-by:" is not guaranteed to be
>> present.
>
> But do we really care about that case where there is no S-o-b:? I
> personally do not think so.
I think we should - the use case I had in mind when I started this is
the Android Git repository, which does not use Signed-off-by. For
example, I quoted this commit in an earlier e-mail [1]:
https://android.googlesource.com/platform/frameworks/base/+/4c5281862f750cbc9d7355a07ef1a5545b9b3523
which has the footer:
Bug: http://b/30562229
Test: readelf --dyn-sym app_process32 and check that bsd_signal is
exported
readelf --dyn-sym app_process64 and check that bsd_signal is
not exported
Change-Id: Iec584070b42bc7fa43b114c0f884aff2db5a6858
>> Defining a trailer line as "a line starting with a token,
>> then optional whitespace, then separator", maybe the following rule:
>> - at least one trailer line generated by Git ("(cherry picked by" or
>> "Signed-off-by") or configured in the "trailer" section in gitconfig
>> OR
>> - at least 3/4 logical trailer lines (I'm wondering if this should be
>> 100% trailer lines)
>
> I'd strongly suggest turning that OR to AND. We will not safely be
> able to write a commit log message that describes how S-o-b lines
> are handled in its last paragraph otherwise.
>
> I do not care too deeply about 3/4, but I meant to allow 75% cruft
> but no more than that, and the fact that the threashold is set at
> way more than 50% is important. IOW, if you have
>
> Ordinary log message here...
>
> S-o-b: A U Thor <au@th.or>
> [a short description that is typically a single liner
> in the real world use pattern we saw in the world, but
> could overflow to become multi line cruft]
> S-o-b: R E Layer <re@lay.er>
>
> "last paragraph" is 5 lines long, among which 60% are cruft that is
> below the 75% threshold, and "am -s" can still add the S-o-b of the
> committer at the end of that existing last paragraph. Making it too
> strict would raise the false negative ratio.
Ah, sorry, I misread your original suggestion.
Would this work then:
- at least one trailer line generated by Git ("(cherry picked by" or
"Signed-off-by: ") or configured in the "trailer" section in
git config AND at least 25% logical trailer lines
OR
- 100% logical trailer lines
The first part is your original suggestion except that I think that it
is more consistent to allow other trailer lines as well (but I do not
feel too strongly about this). The second part would satisfy the Android
Git use case above, and also retain existing behavior when
"Signed-off-by" (for example) is added to an existing footer that does
not contain "Signed-off-by" yet.
What do you think?
[1] Message ID <29cb0f55-f729-80af-cdca-64e927fa97c0@google.com>
^ permalink raw reply
* Re: [PATCH 5/7] merge-base: mark bases that are on first-parent chain
From: Junio C Hamano @ 2016-10-19 17:42 UTC (permalink / raw)
To: git
In-Reply-To: <20161019042345.29766-6-gitster@pobox.com>
Junio C Hamano <gitster@pobox.com> writes:
> In a workflow where topic branches are first merged to the 'next'
> integration branch to be tested before getting merged down to the
> 'master' integration branch to be consumed by the end users, merging
> the 'master' branch back to the 'next' happens after topics graduate
> to 'master' and release notes entries are written for them.
>
> Git finds many merge bases between 'master' and 'next' while
> creating this merge. In addition to the tip of 'master' back when
> we made such a merge back from 'master' to 'next' was made the last
> time, which is the most reasonable merge base to explain the
> histories of both branches, all the tips of topic branches that
> graduated recently are merge bases. Because these tips of topic
> branches were already in 'next', the tip of 'next' reaches them, and
> because they just graduated to 'master', the tip of 'master' reaches
> them, too. And these topics are independent most of the time (that
> is the point of employing the topic-branch workflow), so they cannot
> be reduced.
The idea here is to exclude tips of topic branches as "obviously
less useful as merge bases than the mainline commit". Aside from
the fact that the approach is purely a heuristic that heavily relies
on convention aka "topic branch workflow", there is a caveat (or
more that I haven't thought of yet).
One is that there may be no merge base found that is on the first
parent chain with this particular patch. When any of the topics
that just graduated to 'master' was forked off of 'master' after the
latest merge from 'master' to 'next' was made, then the merge base
on the first parent chain, i.e. the commit on 'master' that was
merged to 'next' the last time, will be an ancestor of the tip of
that recently forked topic, which is another common ancestor between
'master' and 'next' being merged (hence removed as redundant). We
will be left with only the merge bases that are off first-parent
chain, and I think "git merge" will say "no related histories; I
won't merge them".
I do not know if that is a problem in practice, but if it turns out
to be, it probably can be corrected by updating the way how the
paint_down_to_common() function works. It still stops traversal,
even with this patch, when a commit is found to be common and place
it to the "potential merge bases" list, but instead we could keep
digging until we hit a commit that is common between PARENT1 and
PARENT2 and also is on the first-parent chain, without declaring
that we found one result.
But that probably ends up being the same as ignoring all side
branches from merges and finding merge bases only paying attention
to the first-parent chain.
^ permalink raw reply
* Re: Drastic jump in the time required for the test suite
From: Junio C Hamano @ 2016-10-19 17:32 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.2.20.1610191049040.3847@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> What I can also say for certain is that the version from yesterday (commit
> 4ef44ce) was the first one in a week that built successfully and hence
> reached the test phase, and it was the first version of `pu` ever to time
> out after running for 3h.
I am sympathetic, but I'd be lying if I said I can feel your pain.
Admittedly I do not run _all_ the tests (I certainly know that I
exclude the ones behind EXPENSIVE prerequisite), but after every
rebuilding of 'jch' and 'pu', I run the testsuite (and also rebuild
docs) before pushing them out, and "make test && make doc && make
install install-doc" run sequentially for the four integration
branches finishes within 15 minutes, even when I run them after
"make clean".
Perhaps the recent change to run the tests in parallel from slower
to faster under prove may be helping my case.
> Maybe we should start optimizing the tests...
Yup, two things that come to mind are to identify long ones and see
if each of them can be split into two halves that can be run in
parallel, and to go through the tests with fine toothed comb and
remove the ones that test exactly the same thing as another test.
The latter would be very time consuming, though.
^ permalink raw reply
* Re: [PATCH v4 2/7] ref-filter: add function to print single ref_array_item
From: Santiago Torres @ 2016-10-19 17:07 UTC (permalink / raw)
To: Jeff King; +Cc: git, gitster, sunshine, walters, Lukas Puehringer
In-Reply-To: <20161019091641.vcv3snlg5xr3yazs@sigill.intra.peff.net>
[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]
On Wed, Oct 19, 2016 at 05:16:42AM -0400, Jeff King wrote:
> On Wed, Oct 19, 2016 at 04:55:43AM -0400, Jeff King wrote:
>
> > > diff --git a/ref-filter.h b/ref-filter.h
> > > index 14d435e..3d23090 100644
> > > --- a/ref-filter.h
> > > +++ b/ref-filter.h
> > > @@ -107,4 +107,7 @@ struct ref_sorting *ref_default_sorting(void);
> > > /* Function to parse --merged and --no-merged options */
> > > int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset);
> > >
> > > +void pretty_print_ref(const char *name, const unsigned char *sha1,
> > > + const char *format, unsigned kind);
> > > +
> >
> > What are the possible values for "kind"? I guess these should come from
> > FILTER_REFS_TAGS, BRANCHES, etc. It's probably worth documenting that.
> > Alternatively, is it possible to just determine this from the name? It
> > looks like filter_ref_kind() is how it happens for a normal ref-filter.
>
> I guess that may complicate things for the caller you add in this
> series, which may not have a fully-qualified refname (which is obviously
> how filter_ref_kind() figures it out). I'd argue that is a bug, though,
> as things like "%(refname)" are generally expected to print out the
> fully refname ("git tag --format=%(refname)" does so, and you can use
> "%(refname:short)" if you want the shorter part).
Hmm, I hadn't actually noticed that. Do you have any suggestions in how to
address this?
In general this feels like a consequence of disambiguating .git/tags/*
within builtin/tag.c rather than letting ref-filter figure it out.
Thanks,
-Santiago.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH] sha1_name: remove ONELINE_SEEN bit
From: Johannes Schindelin @ 2016-10-19 7:49 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <xmqqd1ixphog.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Tue, 18 Oct 2016, Junio C Hamano wrote:
> 28a4d94044 ("object name: introduce ':/<oneline prefix>' notation",
> 2007-02-24) started using its own bit from object->flags to mark
> commits used while parsing the ":/token" extended SHA-1 syntax to
> name a commit temporarily, and this was kept even when f7bff00314
> ("sha1_name.c: fix parsing of ":/token" syntax", 2010-08-02) found
> and fixed a bug in its implementation.
>
> The use of that flag bit, however, is limited to a single function,
> get_sha1_oneline(), which first sets it for the commits sitting at
> the tips of refs, uses the bit to avoid duplicate traversal while
> walking the history, and then cleans the bit from all commits it
> walked.
>
> Which is exactly what the general-purpose TMP_MARK bit meant to be
> used for isolated case was invented for. Replace ONELINE_SEEN with
> TMP_MARK and retire the former.
ACK,
Dscho
^ permalink raw reply
* Re: Integrating submodules with no side effects
From: Stefan Beller @ 2016-10-19 16:23 UTC (permalink / raw)
To: Robert Dailey; +Cc: Git
In-Reply-To: <CAHd499CN3+cHVwjOEirwXVu3DsJwPrmJwEgSJL2CHD5CvoYxxg@mail.gmail.com>
On Wed, Oct 19, 2016 at 6:27 AM, Robert Dailey <rcdailey.lists@gmail.com> wrote:
> On Tue, Oct 18, 2016 at 4:17 PM, Stefan Beller <sbeller@google.com> wrote:
>> On Tue, Oct 18, 2016 at 12:35 PM, Robert Dailey
>> <rcdailey.lists@gmail.com> wrote:
>>> Hello git experts,
>>>
>>> I have in the past attempted to integrate submodules into my primary
>>> repository using the same directory name. However, this has always
>>> caused headache when going to and from branches that take you between
>>> when this integration occurred and when it didn't. It's a bit hard to
>>> explain. Basically, if I have a submodule "foo", and I delete that
>>> submodule and physically add its files under the same directory "foo",
>>> when I do a pull to get this change from another clone, it fails
>>> saying:
>>>
>>> error: The following untracked working tree files would be overwritten
>>> by checkout:
>>> foo/somefile.txt
>>> Please move or remove them before you switch branches.
>>> Aborting
>>> could not detach HEAD
>>>
>>>
>>> Obviously, git can't delete the submodule because the files have also
>>> been added directly. I don't think it is built to handle this
>>> scenario. Here is the series of commands I ran to "integrate" the
>>> submodule (replace the submodule with a directory containing the exact
>>> contents of the submodule itself):
>>>
>>> #!/usr/bin/env bash
>>> mv "$1" "${1}_"
>>> git submodule deinit "$1"
>>
>> This removes the submodule entries from .git/config
>> (and it would remove the contents of that submodule, but they are moved)
>>
>>> git rm "$1"
>>
>> Removing the git link here.
>>
>> So we still have the entries in the .gitmodules file there.
>> Maybe add:
>>
>> name=$(git submodule-helper name $1)
>> git config -f .gitmodules --unset submodule.$name.*
>> git add .gitmodules
>>
>> ? (Could be optional)
>
> Actually I verified that it seems `git rm` is specialized for
> submodules somewhere, because when I run that command on a submodule
> the relevant entries in the .gitmodules file are removed. I did not
> have to do this as a separate step.
>
>>> mv "${1}_" "$1"
>>> git add "$1/**"
>>
>> Moving back into place and adding all files in there.
>>
>>>
>>> The above script is named git-integrate-submodule, I run it like so:
>>>
>>> $ git integrate-submodule foo
>>>
>>> Then I do:
>>>
>>> $ git commit -m 'Integrated foo submodule'
>>>
>>> Is there any way to make this work nicely?
>>
>> I think you can just remove the gitlink from the index and not from the working
>> tree ("git rm --cached $1")
>
> What is the goal of doing it this way? What does this simplify?
You don't have to mv it back and forth with an underscore I would imagine?
>
>>> The only solution I've
>>> found is to obviously rename the directory before adding the physical
>>> files, for example name it foo1. Because they're different, they never
>>> "clash".
>>
>> Also look at the difference between plumbing and porcelain commands[1],
>> as plumbing is more stable than the porcelain, so it will be easier to maintain
>> this script.
>
> Which plumbing commands did you have in mind?
None specifically. I write scripts using porcelain all the time for
personal use.
But if you were planning to publish this seriously then I'd recommend looking at
plumbing commands.
>
>> I think this would be an actually reasonable feature, which Git itself
>> could support via "git submodule [de]integrate", but then we'd also want
>> to see the reverse, i.e. take a sub directory and make it a submodule.
>
> Integrating this as a feature might be fine, I think when you bring up
> the question of retaining history makes things much harder.
> Fortunately for me that is not a requirement in this case, so I'm able
> to do things with much less effort.
That reminds me of subtree merging, which could be used for this case.
(see 'git subtree')
>
> However the primary purpose of my post was to find out how to
> integrate the submodule without the error on next pull by other
> collaborators of my repository. It's a real pain to recover your
> working copy when going inbetween commits where the submodule
> integration happened inbetween them. I did quote the exact error
> message I got in my original post.
You could try this patch series:
https://github.com/jlehmann/git-submod-enhancements/tree/git-checkout-recurse-submodules
(rebased to a newer version; no functional changes:)
https://github.com/stefanbeller/git/tree/submodule-co
(I'll rebase that later to origin/master)
>
> Do you have any info on how I can prevent that error? Ideally I want
> the integration to go smoothly and transparently, not just for the
> person doing the actual transition (me) but for everyone else that
> gets those changes from upstream. They should not even notice that it
> happened (i.e. no failed commands, awkward behavior, or manual steps).
It depends on how long you want to postpone the transition, but I plan to
upstream the series referenced above in the near future,
which would enable your situation to Just Work (tm). ;)
^ permalink raw reply
* [PATCH] Add a knob to abort on die() (was Re: git checkout crashes after ...)
From: Duy Nguyen @ 2016-10-19 13:47 UTC (permalink / raw)
To: git; +Cc: Raffael Reichelt
In-Reply-To: <CACsJy8B50daiHWfu7zfVQnn_i_=HbUK3gBPmv1U=EUw7ZyuGPw@mail.gmail.com>
On Wed, Oct 19, 2016 at 08:27:43PM +0700, Duy Nguyen wrote:
> If you set the environment variable GIT_ALLOC_LIMIT ... git
> attempts to allocate more than that ... then it's caught and we get
> a glimpse of how much memory git may need. Unfortunately we can't
> get a stack trace or anything like that unless you rebuild Git from
> source.
It's moments like this that I wish we had a knob to force core
dumps. And I often modify die_builtin() to add '*(char*)0 = 1;' to
force a core dump when I can't figure out some problem based on the
error message alone.
So.. how about we do something like this? We could extend it to abort
on error() as well as die(). Aborting on warning() may be a bit too
much though. On glibc systems we could even print the back trace
without aborting, which helps in some cases.
The long variable name and value are on purpose to hopefully not
trigger this by mistake.
diff --git a/git.c b/git.c
index ab5c99c..5fea224 100644
--- a/git.c
+++ b/git.c
@@ -622,15 +622,34 @@ static int run_argv(int *argcp, const char ***argv)
return done_alias;
}
+static NORETURN void die_by_aborting(const char *err, va_list params)
+{
+ vreportf("fatal: ", err, params);
+ abort();
+}
+
+static NORETURN void die_silently_by_aborting(const char *err, va_list params)
+{
+ abort();
+}
+
int cmd_main(int argc, const char **argv)
{
const char *cmd;
int done_help = 0;
+ const char *die_abort_env = getenv("GIT_ABORT_ON_FATAL_ERRORS");
cmd = argv[0];
if (!cmd)
cmd = "git-help";
+ if (die_abort_env) {
+ if (!strcmp(die_abort_env, "yes please"))
+ set_die_routine(die_by_aborting);
+ else if (!strcmp(die_abort_env, "just die"))
+ set_die_routine(die_silently_by_aborting);
+ }
+
trace_command_performance(argv);
/*
--
Duy
^ permalink raw reply related
* Re: [PATCH v4 1/7] gpg-interface, tag: add GPG_VERIFY_QUIET flag
From: Jeff King @ 2016-10-19 8:51 UTC (permalink / raw)
To: santiago; +Cc: git, gitster, sunshine, walters, Lukas Puehringer
In-Reply-To: <20161007210721.20437-2-santiago@nyu.edu>
On Fri, Oct 07, 2016 at 05:07:15PM -0400, santiago@nyu.edu wrote:
> From: Lukas Puehringer <luk.puehringer@gmail.com>
>
> Functions that print git object information may require that the
> gpg-interface functions be silent. Add GPG_VERIFY_QUIET flag and prevent
> print_signature_buffer from being called if flag is set.
The layering here is a little funny. The gpg-interface code allocates a
new flag, but none of its functions do anything with it. Instead, it's
acted on only by the run_gpg_verify() command local to tag.c.
I guess this "flags" variable comes to us from other callsites via
gpg_verify_tag. That's still in tag.c, but it's arguably part of the gpg
interface.
So I think it's OK.
-Peff
^ permalink raw reply
* Drastic jump in the time required for the test suite
From: Johannes Schindelin @ 2016-10-19 9:18 UTC (permalink / raw)
To: gitster; +Cc: git
Hi Junio,
I know you are a fan of testing things thoroughly in the test suite, but I
have to say that it is getting out of hand, in particular due to our
over-use of shell script idioms (which really only run fast on Linux, not
a good idea for a portable software).
My builds of `pu` now time out, after running for 3h straight in the VM
dedicated to perform the daily routine of building and testing the git.git
branches in Git for Windows' SDK. For comparison, `next` passes build &
tests in 2.6h. That is quite the jump.
Unfortunately, I cannot tell you precisely when this massive increase
happened (we are talking about half an hour, after all), because there
were build failures preventing the test from being run for the last 40
days (and my build job only retains the results for 7 days currently,
anyway, in addition to the last successful/unsuccessful build).
What I can say for certain is that the version from 41 days ago (commit
7837d4a) ran for only 2.6h, just as `next` does today, and passed without
failure.
Every single revision of `pu` since then has been broken in one way or
another. Mostly already the build, so that the tests would not even start
to run.
What I can also say for certain is that the version from yesterday (commit
4ef44ce) was the first one in a week that built successfully and hence
reached the test phase, and it was the first version of `pu` ever to time
out after running for 3h.
I will increase the time-out, of course, but we are walking into a
dangerous territory here: the build & test requires such an incredibly
long time now that the VM will start to take more than 24h to complete all
8 tasks (building & testing the `pu`, `next`, `master` and `maint`
branches, as well as trying to rebase Git for Windows' patches onto each
of them).
As those tasks are scheduled to run once every 24h, I will no longer be
able to notify you and the mailing list in a timely manner, if at all,
because the queue will clog up.
Maybe we should start optimizing the tests to become more useful again, by
forcing them not to take such an insane amount of time?
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH v4 2/7] ref-filter: add function to print single ref_array_item
From: Jeff King @ 2016-10-19 8:55 UTC (permalink / raw)
To: santiago; +Cc: git, gitster, sunshine, walters, Lukas Puehringer
In-Reply-To: <20161007210721.20437-3-santiago@nyu.edu>
On Fri, Oct 07, 2016 at 05:07:16PM -0400, santiago@nyu.edu wrote:
> From: Lukas Puehringer <luk.puehringer@gmail.com>
>
> ref-filter functions are useful for printing git object information
> using a format specifier. However, some other modules may not want to use
> this functionality on a ref-array but only print a single item.
>
> Expose a pretty_print_ref function to create, pretty print and free
> individual ref-items.
Makes sense.
> diff --git a/ref-filter.h b/ref-filter.h
> index 14d435e..3d23090 100644
> --- a/ref-filter.h
> +++ b/ref-filter.h
> @@ -107,4 +107,7 @@ struct ref_sorting *ref_default_sorting(void);
> /* Function to parse --merged and --no-merged options */
> int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset);
>
> +void pretty_print_ref(const char *name, const unsigned char *sha1,
> + const char *format, unsigned kind);
> +
What are the possible values for "kind"? I guess these should come from
FILTER_REFS_TAGS, BRANCHES, etc. It's probably worth documenting that.
Alternatively, is it possible to just determine this from the name? It
looks like filter_ref_kind() is how it happens for a normal ref-filter.
-Peff
^ permalink raw reply
* Re: [PATCH v4 2/7] ref-filter: add function to print single ref_array_item
From: Jeff King @ 2016-10-19 9:16 UTC (permalink / raw)
To: santiago; +Cc: git, gitster, sunshine, walters, Lukas Puehringer
In-Reply-To: <20161019085543.om7v7eowfaushags@sigill.intra.peff.net>
On Wed, Oct 19, 2016 at 04:55:43AM -0400, Jeff King wrote:
> > diff --git a/ref-filter.h b/ref-filter.h
> > index 14d435e..3d23090 100644
> > --- a/ref-filter.h
> > +++ b/ref-filter.h
> > @@ -107,4 +107,7 @@ struct ref_sorting *ref_default_sorting(void);
> > /* Function to parse --merged and --no-merged options */
> > int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset);
> >
> > +void pretty_print_ref(const char *name, const unsigned char *sha1,
> > + const char *format, unsigned kind);
> > +
>
> What are the possible values for "kind"? I guess these should come from
> FILTER_REFS_TAGS, BRANCHES, etc. It's probably worth documenting that.
> Alternatively, is it possible to just determine this from the name? It
> looks like filter_ref_kind() is how it happens for a normal ref-filter.
I guess that may complicate things for the caller you add in this
series, which may not have a fully-qualified refname (which is obviously
how filter_ref_kind() figures it out). I'd argue that is a bug, though,
as things like "%(refname)" are generally expected to print out the
fully refname ("git tag --format=%(refname)" does so, and you can use
"%(refname:short)" if you want the shorter part).
-Peff
^ permalink raw reply
* Re: [PATCH v4 5/7] builtin/tag: add --format argument for tag -v
From: Jeff King @ 2016-10-19 9:10 UTC (permalink / raw)
To: santiago; +Cc: git, gitster, sunshine, walters, Lukas Puehringer
In-Reply-To: <20161007210721.20437-6-santiago@nyu.edu>
On Fri, Oct 07, 2016 at 05:07:19PM -0400, santiago@nyu.edu wrote:
> Adding --format to git tag -v mutes the default output of the GPG
> verification and instead prints the formatted tag object.
The same comments apply to "mutes" here, as to the previous patch (which
is to say I think we may want something more, but this is probably OK
for now).
> diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt
> index 7ecca8e..3bb5e3c 100644
> --- a/Documentation/git-tag.txt
> +++ b/Documentation/git-tag.txt
> @@ -15,7 +15,7 @@ SYNOPSIS
> 'git tag' [-n[<num>]] -l [--contains <commit>] [--points-at <object>]
> [--column[=<options>] | --no-column] [--create-reflog] [--sort=<key>]
> [--format=<format>] [--[no-]merged [<commit>]] [<pattern>...]
> -'git tag' -v <tagname>...
> +'git tag' -v [--format=<format>] <tagname>...
Just thinking out loud, but if we had ref-filter placeholders that
triggered GPG verification, you could do this all with the listing mode,
like:
git tag --format='%(gpgstatus) %(tag) %(refname:short)'
and verify multiple tags (or give a single tag to limit it to just one).
I don't think that's any kind of blocker for this series. We already
have "-v", and adding --format to it is reasonable, even if we
eventually move to a world where people can use the listing mode. Like I
said, just thinking out loud.
> +static int for_each_tag_name(const char **argv, each_tag_name_fn fn,
> + void *cb_data)
> {
> const char **p;
> char ref[PATH_MAX];
> int had_error = 0;
> unsigned char sha1[20];
>
> +
> for (p = argv; *p; p++) {
Extra space?
> static int verify_tag(const char *name, const char *ref,
> - const unsigned char *sha1)
> + const unsigned char *sha1, void *cb_data)
> {
> - return verify_and_format_tag(sha1, name, NULL, GPG_VERIFY_VERBOSE);
> + int flags;
Probably doesn't matter much, but these flags are defined as "unsigned"
elsewhere.
-Peff
^ permalink raw reply
* Re: What's cooking in git.git (Oct 2016, #03; Tue, 11)
From: Jeff King @ 2016-10-19 9:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Santiago Torres, git
In-Reply-To: <xmqqtwc9r6uv.fsf@gitster.mtv.corp.google.com>
On Tue, Oct 18, 2016 at 08:53:44AM -0700, Junio C Hamano wrote:
> >> * st/verify-tag (2016-10-10) 7 commits
> [...]
> > Hi, I saw this on the previous "what's cooking." Is there anything I
> > need to do on my side to make sure this is ready for next?
>
> Posting this exact message to the list would be an excellent way
> ;-).
>
> Hopefully some competent reviewer comes and points me at a thread
> where s/he says the series was already reviewed and in good shape
> soonish, and your message may be a good trigger to make it happen.
Another from my list of "things I have been meaning to review". :)
I think this is close, but I had a few nits to pick with the ref-filter
printing interface. I sent comments for each patch in the v4 thread.
-Peff
^ permalink raw reply
* Re: [PATCH v4 6/7] t/t7030-verify-tag: Add --format specifier tests
From: Jeff King @ 2016-10-19 9:13 UTC (permalink / raw)
To: santiago; +Cc: git, gitster, sunshine, walters
In-Reply-To: <20161007210721.20437-7-santiago@nyu.edu>
On Fri, Oct 07, 2016 at 05:07:20PM -0400, santiago@nyu.edu wrote:
> Verify-tag now provides --format specifiers to inspect and ensure the
> contents of the tag are proper. We add two tests to ensure this
> functionality works as expected: the return value should indicate if
> verification passed, and the format specifiers must be respected.
Sounds good.
> +test_expect_success 'verifying tag with --format' '
> + cat >expect <<-\EOF &&
> + tagname : fourth-signed
> + EOF
> + git verify-tag --format="tagname : %(tag)" "fourth-signed" >actual &&
> + test_cmp expect actual
> +'
I suppose it's a matter of style, but for a single-line expectation I
would just do:
echo "tagname : fourth-signed" >expect &&
which is shorter and saves a process invocation.
Ditto on the next patch (which IMHO could just be squashed into a single
patch).
-Peff
^ permalink raw reply
* [BUG] git-stash fails when tracked file is replaced with directory
From: Alex C. Reed, IV @ 2016-10-19 15:34 UTC (permalink / raw)
To: git
When a file is deleted from Git and replaced with a directory+file(s),
git-stash has two unexpected behaviors. This is tested against
versions 2.8.1 and 2.10.1:
1) Old file is removed from index and newly-added directory+file(s)
are added to index.
In this scenario, 'git stash' fails with the message:
error: <directory>: is a directory - add individual files instead
fatal: Unable to process path <directory>
Cannot save the current work tree state
The expected result would be that Git properly records the state
currently stored in index.
2) Old file is removed and new-added directory+file(s) are present
only in worktree, but not added to the index.
In this scenario, 'git stash -u' works fine, but 'git stash apply'
fails with the message:
fatal: cannot create directory at '<directory>': File exists
Could not restore untracked files from stash
The expected result would be that Git removes 'file' and replaces with
the untracked contents recorded in the original stash.
It is worth noting that Git does properly handle the scenario where
the stash operation of (1) is replaced with a commit to a temporary
branch, so this quirk seems to be restricted to stashes only.
I found a similar issue reported 22 April 2016 titled "possible bug of
git stash deleting uncommitted files in corner case". The thread-view
of the message is here:
http://marc.info/?t=146132568600002&r=1&w=2
Here's a quick-and-dirty bash script to re-create all three scenarios
(1, 2, and 'commit to branch'):
===== BEGIN stash-test.sh
#!/bin/bash
set -x
export GIT_TRACE=1
setup() {
repo=$1
# Prepare repo
rm -rf $repo
git init $repo
cd $repo
# Add initial file (symlink to external assets)
ln -fs /external/dir dir
git add dir
git commit -m "Add symlink to /external/dir"
# Replace symlink with local copy of assets
rm dir
mkdir -p dir
touch dir/local_copy_of_dir_files
}
{
( setup stash-test-unstaged
git stash -u
git stash apply )
( setup stash-test-staged
git add .
git stash )
( setup stash-test-commit
git add .
git co -b stash-branch
git commit -m "commit to branch instead of stash" )
} 2>&1 | tee stash-test.log
===== END stash-test.sh
Thanks,
-Alex Reed
^ permalink raw reply
* [regression] `make profile-install` fails in 2.10.1
From: Jan Keromnes @ 2016-10-19 11:15 UTC (permalink / raw)
To: git
Hello,
TL;DR - Probably a regression of a previously reported bug. [0]
I'm trying to `profile-install` Git from source on Ubuntu 16.04, to
have the latest stable Git optimized for my machine.
However, this often fails, because the profile build runs all Git
tests (to get an idea of how Git behaves on my hardware, and optimize
for it), but it bails out if there are any test failures (for me, this
has happened on most Git version upgrades this year, see also [0] and
[1]).
- Problem: Is there a way to `make profile-install` but ignore
occasional test failures, as these are not critical to get a useful
hardware profile? (Note: In a previous thread, Dennis Kaarsemaker
mentioned this is fixing a symptom, not the root cause, but it would
still be great to get a working profile in spite of occasional test
failures.)
- Related problem: `t3700-add.sh` fails again in 2.10.1 for me. More
details below, and I can provide further debug information if you
don't already know the problem.
Thanks,
Jan
[0] "`make profile-install` fails in 2.9.3" -
https://marc.info/?l=git&m=147274608823171&w=2
[1] "Fwd: Git 2.8.1 fails test 32 of t7300-clean.sh, breaks profile
build" - https://marc.info/?l=git&m=146193443529229&w=2
---
Steps to reproduce:
curl https://www.kernel.org/pub/software/scm/git/git-2.10.1.tar.xz
| tar xJ \
&& cd git-2.10.1 \
&& make prefix=/usr profile-install install-man -j18
Expected result:
- runs all tests to get a profile (ignoring occasional failures)
- rebuilds Git with the profile
- installs Git
Actual result:
- runs all tests to get a profile
- at least one test fails, interrupting the whole process
- Git is not installed
Failure log:
(snip)
*** t3700-add.sh ***
ok 1 - Test of git add
ok 2 - Post-check that foo is in the index
ok 3 - Test that "git add -- -q" works
ok 4 - git add: Test that executable bit is not used if core.filemode=0
ok 5 - git add: filemode=0 should not get confused by symlink
(snip)
ok 38 - git add --chmod=[+-]x stages correctly
ok 39 - git add --chmod=+x with symlinks
not ok 40 - git add --chmod=[+-]x changes index with already added file
#
# echo foo >foo3 &&
# git add foo3 &&
# git add --chmod=+x foo3 &&
# test_mode_in_index 100755 foo3 &&
# echo foo >xfoo3 &&
# chmod 755 xfoo3 &&
# git add xfoo3 &&
# git add --chmod=-x xfoo3 &&
# test_mode_in_index 100644 xfoo3
#
ok 41 - git add --chmod=[+-]x does not change the working tree
ok 42 - no file status change if no pathspec is given
ok 43 - no file status change if no pathspec is given in subdir
ok 44 - all statuses changed in folder if . is given
# failed 1 among 44 test(s)
1..44
Makefile:43: recipe for target 't3700-add.sh' failed
make[3]: Leaving directory '/tmp/git/git-2.10.1/t'
make[3]: *** [t3700-add.sh] Error 1
Makefile:36: recipe for target 'test' failed
make[2]: Leaving directory '/tmp/git/git-2.10.1/t'
make[2]: *** [test] Error 2
Makefile:2273: recipe for target 'test' failed
make[1]: *** [test] Error 2
make[1]: Leaving directory '/tmp/git/git-2.10.1'
Makefile:1679: recipe for target 'profile' failed
make: *** [profile] Error 2
The command '/bin/sh -c mkdir /tmp/git && cd /tmp/git && curl
https://www.kernel.org/pub/software/scm/git/git-2.10.1.tar.xz | tar xJ
&& cd git-2.10.1 && make prefix=/usr profile-install install-man
-j18 && rm -rf /tmp/git' returned a non-zero code: 2
^ permalink raw reply
* Re: Integrating submodules with no side effects
From: Robert Dailey @ 2016-10-19 13:27 UTC (permalink / raw)
To: Stefan Beller; +Cc: Git
In-Reply-To: <CAGZ79kaFtzQDZrSJhJZ59xvBzn+6+UVDO65Ac+T6aFxMQaM_xQ@mail.gmail.com>
On Tue, Oct 18, 2016 at 4:17 PM, Stefan Beller <sbeller@google.com> wrote:
> On Tue, Oct 18, 2016 at 12:35 PM, Robert Dailey
> <rcdailey.lists@gmail.com> wrote:
>> Hello git experts,
>>
>> I have in the past attempted to integrate submodules into my primary
>> repository using the same directory name. However, this has always
>> caused headache when going to and from branches that take you between
>> when this integration occurred and when it didn't. It's a bit hard to
>> explain. Basically, if I have a submodule "foo", and I delete that
>> submodule and physically add its files under the same directory "foo",
>> when I do a pull to get this change from another clone, it fails
>> saying:
>>
>> error: The following untracked working tree files would be overwritten
>> by checkout:
>> foo/somefile.txt
>> Please move or remove them before you switch branches.
>> Aborting
>> could not detach HEAD
>>
>>
>> Obviously, git can't delete the submodule because the files have also
>> been added directly. I don't think it is built to handle this
>> scenario. Here is the series of commands I ran to "integrate" the
>> submodule (replace the submodule with a directory containing the exact
>> contents of the submodule itself):
>>
>> #!/usr/bin/env bash
>> mv "$1" "${1}_"
>> git submodule deinit "$1"
>
> This removes the submodule entries from .git/config
> (and it would remove the contents of that submodule, but they are moved)
>
>> git rm "$1"
>
> Removing the git link here.
>
> So we still have the entries in the .gitmodules file there.
> Maybe add:
>
> name=$(git submodule-helper name $1)
> git config -f .gitmodules --unset submodule.$name.*
> git add .gitmodules
>
> ? (Could be optional)
Actually I verified that it seems `git rm` is specialized for
submodules somewhere, because when I run that command on a submodule
the relevant entries in the .gitmodules file are removed. I did not
have to do this as a separate step.
>> mv "${1}_" "$1"
>> git add "$1/**"
>
> Moving back into place and adding all files in there.
>
>>
>> The above script is named git-integrate-submodule, I run it like so:
>>
>> $ git integrate-submodule foo
>>
>> Then I do:
>>
>> $ git commit -m 'Integrated foo submodule'
>>
>> Is there any way to make this work nicely?
>
> I think you can just remove the gitlink from the index and not from the working
> tree ("git rm --cached $1")
What is the goal of doing it this way? What does this simplify?
>> The only solution I've
>> found is to obviously rename the directory before adding the physical
>> files, for example name it foo1. Because they're different, they never
>> "clash".
>
> Also look at the difference between plumbing and porcelain commands[1],
> as plumbing is more stable than the porcelain, so it will be easier to maintain
> this script.
Which plumbing commands did you have in mind?
> I think this would be an actually reasonable feature, which Git itself
> could support via "git submodule [de]integrate", but then we'd also want
> to see the reverse, i.e. take a sub directory and make it a submodule.
Integrating this as a feature might be fine, I think when you bring up
the question of retaining history makes things much harder.
Fortunately for me that is not a requirement in this case, so I'm able
to do things with much less effort.
However the primary purpose of my post was to find out how to
integrate the submodule without the error on next pull by other
collaborators of my repository. It's a real pain to recover your
working copy when going inbetween commits where the submodule
integration happened inbetween them. I did quote the exact error
message I got in my original post.
Do you have any info on how I can prevent that error? Ideally I want
the integration to go smoothly and transparently, not just for the
person doing the actual transition (me) but for everyone else that
gets those changes from upstream. They should not even notice that it
happened (i.e. no failed commands, awkward behavior, or manual steps).
^ permalink raw reply
* Re: git checkout crashes after server being updated to Debian X86_64
From: Duy Nguyen @ 2016-10-19 13:27 UTC (permalink / raw)
To: Raffael Reichelt; +Cc: Git Mailing List
In-Reply-To: <6B2BE996-F696-4EB4-91CA-849D40B8802D@gmail.com>
On Tue, Oct 18, 2016 at 10:17 PM, Raffael Reichelt
<raffael.reichelt@gmail.com> wrote:
> Hello!
>
> I have a serious problem with git, After my provider had updated to a X86_64 architecture git crashes with various memory-related errors. This is happening remote when pushing to the repository from my local machine as well as trying it on a shell on the server itself.
>
> This are the error-messages:
>
> fatal: Out of memory, realloc failed
> fatal: recursion detected in die handler
> fatal: recursion detected in die handler
You other mail said memory is capped at 600MB, which should be a lot
for normal repositories. If you set the environment variable
GIT_ALLOC_LIMIT to maybe 500MB or lower (convert it to kilobytes
first) and git attempts to allocate more than that (just that one
time, not total mem) then it's caught and we get a glimpse of how much
memory git may need. Unfortunately we can't get a stack trace or
anything like that unless you rebuild Git from source.
> or
> fatal: unable to create threaded lstat
> fatal: recursion detected in die handler
Hmm.. with "max user processes (-u) 42" we should be fine because we
only create 20 threads max. What happens if you set core.preloadindex
to false? Can it run until the end or hit some other fatal errors?
There's room for improvement in preload_index(). If we hit resource
limit like this, it's not the end of the world and we should be able
to keep going. But threaded lstat has been available for a long time
and this is the first time I see a report like this, not sure if it's
worth fixing.
--
Duy
^ permalink raw reply
* Re: What's cooking in git.git (Oct 2016, #04; Mon, 17)
From: Jeff King @ 2016-10-19 7:46 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Lars Schneider, git
In-Reply-To: <xmqq4m49pffk.fsf@gitster.mtv.corp.google.com>
On Tue, Oct 18, 2016 at 01:31:27PM -0700, Junio C Hamano wrote:
> >> * ls/filter-process (2016-10-17) 14 commits
> [...]
> > what do you think about v11? Do you feel the series is becoming mature
> > enough for `next`?
>
> I've already had that feeling a few rounds ago, but I haven't had a
> chance to read the most recent one carefully myself to answer that
> question honestly.
FWIW, I gave it a fairly thorough read-over (something I'd been meaning
to do for quite a while, but kept never quite getting around to). I
think overall it is OK for next. I did find one or two nits, but I think
they are things we can fix up in-tree if and when they become a problem
(e.g., I noticed that test-genrandom gets piped to "perl -pe". I'm not
sure if perl will complain about funny multibyte characters on some
systems. I suggest we ignore it until somebody demonstrates that it
actually matters).
-Peff
^ permalink raw reply
* [ANNOUNCE] Git Rev News edition 20
From: Christian Couder @ 2016-10-19 14:13 UTC (permalink / raw)
To: git
Cc: Thomas Ferris Nicolaisen, Jakub Narebski, Junio C Hamano, lwn,
Dennis Kaarsemaker, Johannes Schindelin, Jeff King, Kevin Daudt,
Ramkumar Ramachandra, Stephan Beyer, Johannes Sixt, Eric Sunshine,
Philip Oakley, Andrew Johnson, Stefan Beller, Linus Torvalds,
Lars Schneider, Fredrik Gustafsson, Rich Felker, Kyle J. McKay
Hi everyone,
I'm happy announce that the 20th edition of Git Rev News is now published:
https://git.github.io/rev_news/2016/10/19/edition-20/
Thanks a lot to all the contributors and helpers, especially Jakub,
Dennis, Dscho, Lars and Peff!
Enjoy,
Christian and Thomas.
^ permalink raw reply
* Re: [PATCH] daemon, path.c: fix a bug with ~ in repo paths
From: Duy Nguyen @ 2016-10-19 14:12 UTC (permalink / raw)
To: Luke Shumaker; +Cc: Junio C Hamano, Git Mailing List, Jeff King
In-Reply-To: <87pomxildc.wl-lukeshu@sbcglobal.net>
On Wed, Oct 19, 2016 at 1:05 AM, Luke Shumaker <lukeshu@sbcglobal.net> wrote:
>> I am not sure if it is even a bug. As you can easily lose that
>> tilde that appears in front of subdirectory of /srv/git/ or replace
>> it with something else (e.g. "u/"), this smells like "Don't do it if
>> it hurts" thing to me.
>
> I buy into "Don't do it if it hurts", but that doesn't mean it's not a
> bug on an uncommon edge-case.
The amount of changes is unbelievable for fixing such a rare case
though. I wonder if we can just detect this in daemon.c and pass
"./~foo/bar" instead of "~foo/bar" to enter_repo() in non-strict mode
to "disable" expand_user_path(). If it works, it's much simpler
changes (even though a bit hacky)
--
Duy
^ permalink raw reply
* Re: git checkout crashes after server being updated to Debian X86_64
From: Raffael Reichelt @ 2016-10-19 14:05 UTC (permalink / raw)
To: Duy Nguyen; +Cc: Git Mailing List
In-Reply-To: <CACsJy8B50daiHWfu7zfVQnn_i_=HbUK3gBPmv1U=EUw7ZyuGPw@mail.gmail.com>
> Am 19.10.2016 um 15:27 schrieb Duy Nguyen <pclouds@gmail.com>:
>
> On Tue, Oct 18, 2016 at 10:17 PM, Raffael Reichelt
> <raffael.reichelt@gmail.com> wrote:
>> Hello!
>>
>> I have a serious problem with git, After my provider had updated to a X86_64 architecture git crashes with various memory-related errors. This is happening remote when pushing to the repository from my local machine as well as trying it on a shell on the server itself.
>>
>> This are the error-messages:
>>
>> fatal: Out of memory, realloc failed
>> fatal: recursion detected in die handler
>> fatal: recursion detected in die handler
>
> You other mail said memory is capped at 600MB, which should be a lot
> for normal repositories. If you set the environment variable
> GIT_ALLOC_LIMIT to maybe 500MB or lower (convert it to kilobytes
> first) and git attempts to allocate more than that (just that one
> time, not total mem) then it's caught and we get a glimpse of how much
> memory git may need. Unfortunately we can't get a stack trace or
> anything like that unless you rebuild Git from source.
This was no change: crashed with the same errors …
>
>> or
>> fatal: unable to create threaded lstat
>> fatal: recursion detected in die handler
>
> Hmm.. with "max user processes (-u) 42" we should be fine because we
> only create 20 threads max. What happens if you set core.preloadindex
> to false? Can it run until the end or hit some other fatal errors?
>
This did the trick :) I just repeatedly did a forced checkout and it went until the end without errors
THX a lot!
Raffael
^ permalink raw reply
* Re: [PATCH v4 4/7] builtin/verify-tag: add --format to verify-tag
From: Jeff King @ 2016-10-19 9:04 UTC (permalink / raw)
To: santiago; +Cc: git, gitster, sunshine, walters
In-Reply-To: <20161007210721.20437-5-santiago@nyu.edu>
On Fri, Oct 07, 2016 at 05:07:18PM -0400, santiago@nyu.edu wrote:
> @@ -46,12 +50,17 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
> if (verbose)
> flags |= GPG_VERIFY_VERBOSE;
>
> + if (fmt_pretty) {
> + verify_ref_format(fmt_pretty);
> + flags |= GPG_VERIFY_QUIET;
> + }
I see why you would want to disable the normal output when there is a
custom format. But it seems a shame that the GPG information cannot be
retrieved as part of that format.
I think in the long run we'd want something like pretty.c's "%G"
placeholders for the ref-filter pretty-printer. But I think we are OK to
do this patch without it. It allows at least:
tag=v2.0.0
got=$(git verify-tag --format='%(tag)' "$tag") &&
test "$tag" = "$got" ||
echo >&2 "verification failed"
which is better than what we have now, and can be extended in the
future.
-Peff
^ permalink raw reply
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