* Re: [PATCH] http(s): automatically try NTLM authentication first
From: Junio C Hamano @ 2017-02-22 21:57 UTC (permalink / raw)
To: Jeff King; +Cc: David Turner, git, sandals, Johannes Schindelin, Eric Sunshine
In-Reply-To: <20170222213542.opunuepfmj557zyr@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> On Wed, Feb 22, 2017 at 01:25:11PM -0800, Junio C Hamano wrote:
>>
>> Thanks for your thoughts. I'd think that we should take this change
>> and leave the optimization for later, then. It's not like the
>> change of the default is making the normal situation any worse, it
>> seems.
>
> I'm not excited that it will start making known bogus-username requests
> by default to servers which do not even support Negotiate. I guess that
> is really the server-operators problem, but it feels pretty hacky.
I guess that's another valid concern. The servers used to be able
to say "Ah, this repository needs auth and this request does not, so
reject it without asking the auth-db". Now it must say "Ah, this
repository needs auth and this request does have one, but it is
empty so let's not even bother the auth-db" in order to reject a
useless "empty-auth" request with the same efficiency.
After the first request without auth (that fails), do we learn
anything useful from the server side (like "it knows Negotiate")
that we can use to flip the "empty-auth" bit to give a better
default to people from both worlds, I wonder...?
^ permalink raw reply
* Re: [PATCH] http(s): automatically try NTLM authentication first
From: Jeff King @ 2017-02-22 21:35 UTC (permalink / raw)
To: Junio C Hamano
Cc: David Turner, git, sandals, Johannes Schindelin, Eric Sunshine
In-Reply-To: <xmqq4lzlc408.fsf@gitster.mtv.corp.google.com>
On Wed, Feb 22, 2017 at 01:25:11PM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > I don't think it incurs an extra round-trip now, because of the way
> > libcurl works. Though I think it _does_ make it harder for curl to later
> > optimize out that extra round-trip.
> > ...
> > In the current trace, you can see that libcurl insists on making a
> > second auth-less request after we've fed it credentials. I'm not sure
> > how to get rid of this useless extra round-trip, but it would be nice to
> > do so (IIRC, it is a probe request to find out the list of auth types
> > that the server supports, which are not remembered from the previous
> > request).
> > ...
> > With http.emptyauth, the second round-trip _isn't_ useless. It's trying
> > to send the empty credential.
> >
> > So while curl isn't currently optimizing out the second call, I think
> > http.emptyauth makes it harder to do the right thing.
> > ...
> > I think that would keep it to 2 round-trips for the normal "Basic" case,
> > as well as for the GSSNegotiate case. It would be 3 requests when the
> > server offers GSSNegotiate but you can't use it (but you could set
> > http.emptyauth=false to optimize that out).
>
> Thanks for your thoughts. I'd think that we should take this change
> and leave the optimization for later, then. It's not like the
> change of the default is making the normal situation any worse, it
> seems.
I'm not excited that it will start making known bogus-username requests
by default to servers which do not even support Negotiate. I guess that
is really the server-operators problem, but it feels pretty hacky.
-Peff
^ permalink raw reply
* Re: [PATCH] http(s): automatically try NTLM authentication first
From: Jeff King @ 2017-02-22 21:34 UTC (permalink / raw)
To: Junio C Hamano
Cc: David Turner, git@vger.kernel.org, sandals@crustytoothpaste.net,
Johannes Schindelin, Eric Sunshine
In-Reply-To: <xmqq8toyapu6.fsf@gitster.mtv.corp.google.com>
On Wed, Feb 22, 2017 at 01:16:33PM -0800, Junio C Hamano wrote:
> David Turner <David.Turner@twosigma.com> writes:
>
> > Always, no. For failed authentication (or authorization), apparently, yes.
> > I tested this by setting the variable to false and then true, and trying to
> > Push to a github repository which I didn't have write access to, with
> > both an empty username (https://@:github.com/...) and no username
> > (http://github.com/...). I ran this under GIT_CURL_VERBOSE=1 and
> > I saw two 401 responses in the "http.emptyauth=true" case and one
> > in the false case. I also tried with a repo that I did have access to (first
> > configuring the necessary tokens for HTTPS push access), and saw two
> > 401 responses in *both* cases.
>
> Thanks; that matches my observation. I do not think we care about
> an extra roundtrip for the failure case, but as long as we do not
> increase the number of roundtrip in the normal case, we can declare
> that this is an improvement. I am not quite sure where that extra
> 401 comes from in the normal case, and that might be an indication
> that we already are doing something wrong, though.
This patch drops the useless probe request:
diff --git a/http.c b/http.c
index 943e630ea..7b4c2db86 100644
--- a/http.c
+++ b/http.c
@@ -1663,6 +1663,9 @@ static int http_request(const char *url,
curlinfo_strbuf(slot->curl, CURLINFO_EFFECTIVE_URL,
options->effective_url);
+ if (results.auth_avail == CURLAUTH_BASIC)
+ http_auth_methods = CURLAUTH_BASIC;
+
curl_slist_free_all(headers);
strbuf_release(&buf);
but setting http.emptyauth adds back in the useless request. I think
that could be fixed by skipping the empty-auth thing when
http_auth_methods does not have CURLAUTH_NEGOTIATE in it (or perhaps
other methods need it to, so maybe skip it if _just_ BASIC is set).
I suspect the patch above could probably be generalized as:
/* cut out methods we know the server doesn't support */
http_auth_methods &= results.auth_avail;
and let curl figure it out from there.
-Peff
^ permalink raw reply related
* Re: [PATCH] http(s): automatically try NTLM authentication first
From: Junio C Hamano @ 2017-02-22 21:25 UTC (permalink / raw)
To: Jeff King; +Cc: David Turner, git, sandals, Johannes Schindelin, Eric Sunshine
In-Reply-To: <20170222210636.k2ps3qhhpiyyv6cp@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I don't think it incurs an extra round-trip now, because of the way
> libcurl works. Though I think it _does_ make it harder for curl to later
> optimize out that extra round-trip.
> ...
> In the current trace, you can see that libcurl insists on making a
> second auth-less request after we've fed it credentials. I'm not sure
> how to get rid of this useless extra round-trip, but it would be nice to
> do so (IIRC, it is a probe request to find out the list of auth types
> that the server supports, which are not remembered from the previous
> request).
> ...
> With http.emptyauth, the second round-trip _isn't_ useless. It's trying
> to send the empty credential.
>
> So while curl isn't currently optimizing out the second call, I think
> http.emptyauth makes it harder to do the right thing.
> ...
> I think that would keep it to 2 round-trips for the normal "Basic" case,
> as well as for the GSSNegotiate case. It would be 3 requests when the
> server offers GSSNegotiate but you can't use it (but you could set
> http.emptyauth=false to optimize that out).
Thanks for your thoughts. I'd think that we should take this change
and leave the optimization for later, then. It's not like the
change of the default is making the normal situation any worse, it
seems.
^ permalink raw reply
* Re: [PATCH] http(s): automatically try NTLM authentication first
From: Junio C Hamano @ 2017-02-22 21:16 UTC (permalink / raw)
To: David Turner
Cc: git@vger.kernel.org, sandals@crustytoothpaste.net,
Johannes Schindelin, Eric Sunshine, Jeff King
In-Reply-To: <97ab9a812f7b46d7b10d4d06f73259d8@exmbdft7.ad.twosigma.com>
David Turner <David.Turner@twosigma.com> writes:
> Always, no. For failed authentication (or authorization), apparently, yes.
> I tested this by setting the variable to false and then true, and trying to
> Push to a github repository which I didn't have write access to, with
> both an empty username (https://@:github.com/...) and no username
> (http://github.com/...). I ran this under GIT_CURL_VERBOSE=1 and
> I saw two 401 responses in the "http.emptyauth=true" case and one
> in the false case. I also tried with a repo that I did have access to (first
> configuring the necessary tokens for HTTPS push access), and saw two
> 401 responses in *both* cases.
Thanks; that matches my observation. I do not think we care about
an extra roundtrip for the failure case, but as long as we do not
increase the number of roundtrip in the normal case, we can declare
that this is an improvement. I am not quite sure where that extra
401 comes from in the normal case, and that might be an indication
that we already are doing something wrong, though.
^ permalink raw reply
* Re: [PATCH] http(s): automatically try NTLM authentication first
From: Jeff King @ 2017-02-22 21:06 UTC (permalink / raw)
To: Junio C Hamano
Cc: David Turner, git, sandals, Johannes Schindelin, Eric Sunshine
In-Reply-To: <xmqqpoiaasgj.fsf@gitster.mtv.corp.google.com>
On Wed, Feb 22, 2017 at 12:19:56PM -0800, Junio C Hamano wrote:
> > It would be one thing if cURL would not let the user specify credentials
> > interactively after attempting NTLM authentication (i.e. login
> > credentials), but that is not the case.
> >
> > It would be another thing if attempting NTLM authentication was not
> > usually what users need to do when trying to authenticate via https://.
> > But that is also not the case.
>
> Some other possible worries we may have had I can think of are:
>
> - With this enabled unconditionally, would we leak some information?
>
> - With this enabled unconditionally, would we always incur an extra
> roundtrip for people who are not running NTLM at all?
>
> I do not think the former is the case, but what would I know (adding a
> few people involved in the original thread to CC: ;-)
I don't think it incurs an extra round-trip now, because of the way
libcurl works. Though I think it _does_ make it harder for curl to later
optimize out that extra round-trip.
The easiest way to see the difference is to run something like:
GIT_CURL_VERBOSE=1 \
git ls-remote https://example.com/repo-which-needs-auth.git 2>trace
egrep '^>|^< HTTP|Authorization' trace
Before this patch, I get (this is against github.com, which only does
Basic auth):
> GET /repo.git/info/refs?service=git-upload-pack HTTP/1.1
< HTTP/1.1 401 Authorization Required
> GET /repo.git/info/refs?service=git-upload-pack HTTP/1.1
< HTTP/1.1 401 Authorization Required
> GET /repo.git/info/refs?service=git-upload-pack HTTP/1.1
Authorization: Basic <actual credentials>
< HTTP/1.1 200 OK
And after I get:
> GET /repo.git/info/refs?service=git-upload-pack HTTP/1.1
< HTTP/1.1 401 Authorization Required
> GET /repo.git/info/refs?service=git-upload-pack HTTP/1.1
Authorization: Basic Og==
< HTTP/1.1 401 Authorization Required
> GET /repo.git/info/refs?service=git-upload-pack HTTP/1.1
Authorization: Basic <actual credentials>
< HTTP/1.1 200 OK
In the current trace, you can see that libcurl insists on making a
second auth-less request after we've fed it credentials. I'm not sure
how to get rid of this useless extra round-trip, but it would be nice to
do so (IIRC, it is a probe request to find out the list of auth types
that the server supports, which are not remembered from the previous
request).
With http.emptyauth, the second round-trip _isn't_ useless. It's trying
to send the empty credential.
So while curl isn't currently optimizing out the second call, I think
http.emptyauth makes it harder to do the right thing. That's probably
fixable if the logic ends up more like:
- curl reports a 401 to us; actually look at the list of auth methods.
- if there was gss-negotiate, then kick in the empty-auth magic
automatically.
- if empty-auth failed (or if we decided not to try it), ask for a
credential and retry the request. Either way, tell curl that we want
to use "Basic" so it doesn't have to do the probe request (and
obviously if the server did not support Basic, then fail
immediately).
I think that would keep it to 2 round-trips for the normal "Basic" case,
as well as for the GSSNegotiate case. It would be 3 requests when the
server offers GSSNegotiate but you can't use it (but you could set
http.emptyauth=false to optimize that out).
That's all theoretical, though. I might not even be right about the
reason for the second request, and I certainly haven't written any code
(nor do I have a GSSNegotiate setup to test against).
-Peff
^ permalink raw reply
* Re: [PATCH] Documentation: Link git-ls-files to core.quotePath variable.
From: Andreas Heiduk @ 2017-02-22 21:08 UTC (permalink / raw)
To: Junio C Hamano, Philip Oakley; +Cc: git
In-Reply-To: <xmqqh93maqgw.fsf@gitster.mtv.corp.google.com>
@Phillip: Thanks.
@Junio: Don't bother, I'm about to fix other man-pages with the text
from ls-files. I will include that typo-fix and prepare a new patch
based on maint.
Am 22.02.2017 um 22:02 schrieb Junio C Hamano:
> "Philip Oakley" <philipoakley@iee.org> writes:
>> s/option pathnamens/option, pathnames/ # comma and spelling.
>
> Thanks. Will squash it in while queuing (I need to discard the new
> text added in the previous attempt in the preimage to make it apply,
> too).
>
^ permalink raw reply
* RE: [PATCH] http(s): automatically try NTLM authentication first
From: David Turner @ 2017-02-22 21:04 UTC (permalink / raw)
To: 'Junio C Hamano'
Cc: git@vger.kernel.org, sandals@crustytoothpaste.net,
Johannes Schindelin, Eric Sunshine, Jeff King
In-Reply-To: <xmqqpoiaasgj.fsf@gitster.mtv.corp.google.com>
> -----Original Message-----
> From: Junio C Hamano [mailto:jch2355@gmail.com] On Behalf Of Junio C
> Hamano
> Sent: Wednesday, February 22, 2017 3:20 PM
> To: David Turner <David.Turner@twosigma.com>
> Cc: git@vger.kernel.org; sandals@crustytoothpaste.net; Johannes Schindelin
> <johannes.schindelin@gmx.de>; Eric Sunshine
> <sunshine@sunshineco.com>; Jeff King <peff@peff.net>
> Subject: Re: [PATCH] http(s): automatically try NTLM authentication first
>
> David Turner <dturner@twosigma.com> writes:
>
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > It is common in corporate setups to have permissions managed via a
> > domain account. That means that the user does not really have to log
> > in when accessing a central repository via https://, but that the
> > login credentials are used to authenticate with that repository.
> >
> > The common way to do that used to require empty credentials, i.e.
> > hitting Enter twice when being asked for user name and password, or by
> > using the very funny notation https://:@server/repository
> >
> > A recent commit (5275c3081c (http: http.emptyauth should allow empty
> > (not just NULL) usernames, 2016-10-04)) broke that usage, though, all
> > of a sudden requiring users to set http.emptyAuth = true.
> >
> > Which brings us to the bigger question why http.emptyAuth defaults to
> > false, to begin with.
>
> This is a valid question, and and I do not see it explicitly asked in the thread:
>
> https://public-
> inbox.org/git/CAPig+cSphEu3iRJrkdBA+BRhi9HnopLJnKOHVuGhUqavtV1RXg
> @mail.gmail.com/#t
>
> even though there is a hint of it already there.
>
> > It would be one thing if cURL would not let the user specify
> > credentials interactively after attempting NTLM authentication (i.e.
> > login credentials), but that is not the case.
> >
> > It would be another thing if attempting NTLM authentication was not
> > usually what users need to do when trying to authenticate via https://.
> > But that is also not the case.
>
> Some other possible worries we may have had I can think of are:
>
> - With this enabled unconditionally, would we leak some information?
I think "NTLM" is actually a misnomer here (I just copied Johannes's
commit message). The mechanism is actually SPNEGO, if I understand this
correctly. It seems to me that this is probably secure, since it is apparently
widely implemented in browsers.
> - With this enabled unconditionally, would we always incur an extra
> roundtrip for people who are not running NTLM at all?
>
> I do not think the former is the case, but what would I know (adding a few
> people involved in the original thread to CC: ;-)
Always, no. For failed authentication (or authorization), apparently, yes.
I tested this by setting the variable to false and then true, and trying to
Push to a github repository which I didn't have write access to, with
both an empty username (https://@:github.com/...) and no username
(http://github.com/...). I ran this under GIT_CURL_VERBOSE=1 and
I saw two 401 responses in the "http.emptyauth=true" case and one
in the false case. I also tried with a repo that I did have access to (first
configuring the necessary tokens for HTTPS push access), and saw two
401 responses in *both* cases.
^ permalink raw reply
* Re: [PATCH v5 00/24] Remove submodule from files-backend.c
From: Junio C Hamano @ 2017-02-22 21:04 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy
Cc: git, Michael Haggerty, Johannes Schindelin, Ramsay Jones,
Stefan Beller, novalis
In-Reply-To: <xmqqlgsycfeu.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
>
>> v5 goes a bit longer than v4, basically:
>>
>> - files_path() is broken down into three smaller functions,
>> files_{packed_refs,reflog,refname}_path().
>>
>> - most of store-based api is added because..
>>
>> - test-ref-store.c is added with t1405 and t1406 for some basic tests
>> I'm not aimimg for complete ref store coverage. But we can continue
>> to improve from there.
>>
>> - refs_store_init() now takes a "permission" flag, like open().
>> Operations are allowed or forbidden based on this flag. The
>> submodule_allowed flag is killed. files_assert_main.. remains.
>>
>> - get_*_ref_store() remain public api because it's used by
>> test-ref-store.c and pack-refs.c.
>>
>> - files-backend.c should now make no function calls that implicitly
>> target the main store. But this will have to be tested more to be
>> sure. I'm tempted to add a tracing backend just for this purpose.
>
> OK.
>
>> Junio, if you take this on 'pu', you'll have to kick my other two
>> series out (they should not even compile). I'm not resending them
>> until I get a "looks mostly ok" from Michael. No point in updating
>> them when this series keeps moving.
>
> Thanks for a note.
As this round seems to have added conflicts with another topic that
is already in flight that the previous round did not conflict with,
I'll eject all three for now until this one solidifies a bit more.
^ permalink raw reply
* Re: [PATCH] Documentation: Link git-ls-files to core.quotePath variable.
From: Junio C Hamano @ 2017-02-22 21:02 UTC (permalink / raw)
To: Philip Oakley; +Cc: Andreas Heiduk, git
In-Reply-To: <F71515D0E29940CA9C421D18480AD726@PhilipOakley>
"Philip Oakley" <philipoakley@iee.org> writes:
>> -When `-z` option is not used, TAB, LF, and backslash characters
>> -in pathnames are represented as `\t`, `\n`, and `\\`,
>> -respectively. The path is also quoted according to the
>> -configuration variable `core.quotePath` (see linkgit:git-config[1]).
>> +Without the `-z` option pathnamens with "unusual" characters are
>
> s/option pathnamens/option, pathnames/ # comma and spelling.
Thanks. Will squash it in while queuing (I need to discard the new
text added in the previous attempt in the preimage to make it apply,
too).
-- >8 --
From: Andreas Heiduk <asheiduk@gmail.com>
Date: Wed, 22 Feb 2017 02:38:21 +0100
Subject: [PATCH] Documentation: clarify core.quotePath and update git-ls-files doc
Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/config.txt | 22 ++++++++++++----------
Documentation/git-ls-files.txt | 10 ++++++----
2 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index f4721a048b..25e65aeb01 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -340,16 +340,18 @@ core.checkStat::
all fields, including the sub-second part of mtime and ctime.
core.quotePath::
- The commands that output paths (e.g. 'ls-files',
- 'diff'), when not given the `-z` option, will quote
- "unusual" characters in the pathname by enclosing the
- pathname in a double-quote pair and with backslashes the
- same way strings in C source code are quoted. If this
- variable is set to false, the bytes higher than 0x80 are
- not quoted but output as verbatim. Note that double
- quote, backslash and control characters are always
- quoted without `-z` regardless of the setting of this
- variable.
+ Commands that output paths (e.g. 'ls-files', 'diff'), will
+ quote "unusual" characters in the pathname by enclosing the
+ pathname in double-quotes and escaping those characters with
+ backslashes in the same way C escapes control characters (e.g.
+ `\t` for TAB, `\n` for LF, `\\` for backslash) or bytes with
+ values larger than 0x80 (e.g. octal `\265` for "micro"). If
+ this variable is set to false, bytes higher than 0x80 are not
+ considered "unusual" any more. Double-quotes, backslash and
+ control characters are always escaped regardless of the
+ setting of this variable. Many commands can output pathnames
+ completely verbatim using the `-z` option. The default value is
+ true.
core.eol::
Sets the line ending type to use in the working directory for
diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt
index 078b556665..a415223b45 100644
--- a/Documentation/git-ls-files.txt
+++ b/Documentation/git-ls-files.txt
@@ -76,7 +76,8 @@ OPTIONS
succeed.
-z::
- \0 line termination on output.
+ \0 line termination on output and do not quote filenames.
+ See OUTPUT below for more information.
-x <pattern>::
--exclude=<pattern>::
@@ -192,9 +193,10 @@ the index records up to three such pairs; one from tree O in stage
the user (or the porcelain) to see what should eventually be recorded at the
path. (see linkgit:git-read-tree[1] for more information on state)
-When `-z` option is not used, TAB, LF, and backslash characters
-in pathnames are represented as `\t`, `\n`, and `\\`,
-respectively.
+Without the `-z` option, pathnames with "unusual" characters are
+quoted as explained for the configuration variable `core.quotePath`
+(see linkgit:git-config[1]). Using `-z` the filename is output
+verbatim and the line is terminated by a NUL byte.
Exclude Patterns
--
2.12.0-rc2-250-gd33575c7f2
^ permalink raw reply related
* Re: [PATCH] git add -i: replace \t with blanks in the help message
From: Junio C Hamano @ 2017-02-22 20:50 UTC (permalink / raw)
To: Ralf Thielow; +Cc: git, Jiang Xin
In-Reply-To: <20170222184627.3811-1-ralf.thielow@gmail.com>
Ralf Thielow <ralf.thielow@gmail.com> writes:
> Within the help message of 'git add -i', the 'diff' command uses one
> tab character and blanks to create the space between the name and the
> description while the others use blanks only. So if the tab size is
> not at 4 characters, this description will not be in range.
> Replace the tab character with blanks.
>
> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
> ---
> git-add--interactive.perl | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks, this was me being sloppy in the very first version.
Will queue.
>
> diff --git a/git-add--interactive.perl b/git-add--interactive.perl
> index cf6fc926a..982593c89 100755
> --- a/git-add--interactive.perl
> +++ b/git-add--interactive.perl
> @@ -1678,7 +1678,7 @@ status - show paths with changes
> update - add working tree state to the staged set of changes
> revert - revert staged set of changes back to the HEAD version
> patch - pick hunks and update selectively
> -diff - view diff between HEAD and index
> +diff - view diff between HEAD and index
> add untracked - add contents of untracked files to the staged set of changes
> EOF
> }
^ permalink raw reply
* Re: [PATCH] submodule init: warn about falling back to a local path
From: Philip Oakley @ 2017-02-22 15:01 UTC (permalink / raw)
To: Stefan Beller, jrnieder; +Cc: git, gitster, sop, Stefan Beller
In-Reply-To: <20170221231815.4123-1-sbeller@google.com>
From: "Stefan Beller" <sbeller@google.com>
> When a submodule is initialized, the config variable
> 'submodule.<name>.url'
> is set depending on the value of the same variable in the .gitmodules
> file. When the URL indicates to be relative, then the url is computed
> relative to its default remote. The default remote cannot be determined
> accurately in all cases, such that it falls back to 'origin'.
>
> The 'origin' remote may not exist, though. In that case we give up looking
> for a suitable remote and we'll just assume it to be a local relative
> path.
>
> This can be confusing to users as there is a lot of guessing involved,
> which is not obvious to the user.
Would a note in the user docs about the fallback you list above also be
useful?
>
> So in the corner case of assuming a local autoritative truth, warn the
> user to lessen the confusion.
>
> This behavior was introduced in 4d6893200 (submodule add: allow relative
> repository path even when no url is set, 2011-06-06), which shared the
> code with submodule-init and then ported to C in 3604242f080a (submodule:
> port init from shell to C, 2016-04-15).
>
> In case of submodule-add, this behavior makes sense in some use cases[1],
> however for submodule-init there does not seem to be an immediate obvious
> use case to fall back to a local submodule. However there might be, so
> warn instead of die here.
>
> [1] e.g.
> http://stackoverflow.com/questions/8721984/git-ignore-files-for-public-repository-but-not-for-private
> "store a secret locally in a submodule, with no intention to publish it"
>
> Reported-by: Shawn Pearce <spearce@spearce.org>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
> builtin/submodule--helper.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
--
Philip
^ permalink raw reply
* Re: [PATCH] Documentation: Link git-ls-files to core.quotePath variable.
From: Philip Oakley @ 2017-02-22 12:21 UTC (permalink / raw)
To: Junio C Hamano, Andreas Heiduk; +Cc: git
In-Reply-To: <e55b3cb7-65bf-1609-2e8d-823b4336e07a@gmail.com>
From: "Andreas Heiduk" <asheiduk@gmail.com>
> [PATCH] Documentation: Clarify core.quotePath, remove cruft in
> git-ls-files.
>
> Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
> ---
>
> I have merged the best parts about quoting into the core.quotePath
> description and cleaned up the text in git-ls-files.txt regarding the
> control characters.
>
>
> Documentation/config.txt | 22 ++++++++++++----------
> Documentation/git-ls-files.txt | 11 ++++++-----
> 2 files changed, 18 insertions(+), 15 deletions(-)
>
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index f4721a0..25e65ae 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -340,16 +340,18 @@ core.checkStat::
> all fields, including the sub-second part of mtime and ctime.
>
> core.quotePath::
> - The commands that output paths (e.g. 'ls-files',
> - 'diff'), when not given the `-z` option, will quote
> - "unusual" characters in the pathname by enclosing the
> - pathname in a double-quote pair and with backslashes the
> - same way strings in C source code are quoted. If this
> - variable is set to false, the bytes higher than 0x80 are
> - not quoted but output as verbatim. Note that double
> - quote, backslash and control characters are always
> - quoted without `-z` regardless of the setting of this
> - variable.
> + Commands that output paths (e.g. 'ls-files', 'diff'), will
> + quote "unusual" characters in the pathname by enclosing the
> + pathname in double-quotes and escaping those characters with
> + backslashes in the same way C escapes control characters (e.g.
> + `\t` for TAB, `\n` for LF, `\\` for backslash) or bytes with
> + values larger than 0x80 (e.g. octal `\265` for "micro"). If
> + this variable is set to false, bytes higher than 0x80 are not
> + considered "unusual" any more. Double-quotes, backslash and
> + control characters are always escaped regardless of the
> + setting of this variable. Many commands can output pathnames
> + completely verbatim using the `-z` option. The default value is
> + true.
>
> core.eol::
> Sets the line ending type to use in the working directory for
> diff --git a/Documentation/git-ls-files.txt
> b/Documentation/git-ls-files.txt
> index d2b17f2..88df561 100644
> --- a/Documentation/git-ls-files.txt
> +++ b/Documentation/git-ls-files.txt
> @@ -76,7 +76,8 @@ OPTIONS
> succeed.
>
> -z::
> - \0 line termination on output.
> + \0 line termination on output and do not quote filenames.
> + See OUTPUT below for more information.
>
> -x <pattern>::
> --exclude=<pattern>::
> @@ -192,10 +193,10 @@ the index records up to three such pairs; one from
> tree O in stage
> the user (or the porcelain) to see what should eventually be recorded
> at the
> path. (see linkgit:git-read-tree[1] for more information on state)
>
> -When `-z` option is not used, TAB, LF, and backslash characters
> -in pathnames are represented as `\t`, `\n`, and `\\`,
> -respectively. The path is also quoted according to the
> -configuration variable `core.quotePath` (see linkgit:git-config[1]).
> +Without the `-z` option pathnamens with "unusual" characters are
s/option pathnamens/option, pathnames/ # comma and spelling.
> +quoted as explained for the configuration variable `core.quotePath`
> +(see linkgit:git-config[1]). Using `-z` the filename is output
> +verbatim and the line is terminated by a NUL byte.
>
--
Philip
^ permalink raw reply
* Re: [PATCH] http(s): automatically try NTLM authentication first
From: Junio C Hamano @ 2017-02-22 20:19 UTC (permalink / raw)
To: David Turner; +Cc: git, sandals, Johannes Schindelin, Eric Sunshine, Jeff King
In-Reply-To: <20170222173936.25016-1-dturner@twosigma.com>
David Turner <dturner@twosigma.com> writes:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> It is common in corporate setups to have permissions managed via a
> domain account. That means that the user does not really have to log in
> when accessing a central repository via https://, but that the login
> credentials are used to authenticate with that repository.
>
> The common way to do that used to require empty credentials, i.e. hitting
> Enter twice when being asked for user name and password, or by using the
> very funny notation https://:@server/repository
>
> A recent commit (5275c3081c (http: http.emptyauth should allow empty (not
> just NULL) usernames, 2016-10-04)) broke that usage, though, all of a
> sudden requiring users to set http.emptyAuth = true.
>
> Which brings us to the bigger question why http.emptyAuth defaults to
> false, to begin with.
This is a valid question, and and I do not see it explicitly asked
in the thread:
https://public-inbox.org/git/CAPig+cSphEu3iRJrkdBA+BRhi9HnopLJnKOHVuGhUqavtV1RXg@mail.gmail.com/#t
even though there is a hint of it already there.
> It would be one thing if cURL would not let the user specify credentials
> interactively after attempting NTLM authentication (i.e. login
> credentials), but that is not the case.
>
> It would be another thing if attempting NTLM authentication was not
> usually what users need to do when trying to authenticate via https://.
> But that is also not the case.
Some other possible worries we may have had I can think of are:
- With this enabled unconditionally, would we leak some information?
- With this enabled unconditionally, would we always incur an extra
roundtrip for people who are not running NTLM at all?
I do not think the former is the case, but what would I know (adding a
few people involved in the original thread to CC: ;-)
> Documentation/config.txt | 3 ++-
> http.c | 2 +-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index fc5a28a320..b0da64ed33 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -1742,7 +1742,8 @@ http.emptyAuth::
> Attempt authentication without seeking a username or password. This
> can be used to attempt GSS-Negotiate authentication without specifying
> a username in the URL, as libcurl normally requires a username for
> - authentication.
> + authentication. Default is true, since if this fails, git will fall
> + back to asking the user for their username/password.
>
> http.delegation::
> Control GSSAPI credential delegation. The delegation is disabled
> diff --git a/http.c b/http.c
> index 90a1c0f113..943e630ea6 100644
> --- a/http.c
> +++ b/http.c
> @@ -109,7 +109,7 @@ static int curl_save_cookies;
> struct credential http_auth = CREDENTIAL_INIT;
> static int http_proactive_auth;
> static const char *user_agent;
> -static int curl_empty_auth;
> +static int curl_empty_auth = 1;
>
> enum http_follow_config http_follow_config = HTTP_FOLLOW_INITIAL;
^ permalink raw reply
* Re: [PATCH v5 03/19] builtin/diff-tree: convert to struct object_id
From: Junio C Hamano @ 2017-02-22 20:04 UTC (permalink / raw)
To: Jeff King; +Cc: brian m. carlson, git, Michael Haggerty, Ramsay Jones
In-Reply-To: <20170222191641.o2rtt2ymtb4h2yqe@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> On Wed, Feb 22, 2017 at 10:50:21AM -0800, Junio C Hamano wrote:
>
>> What the function does appears somewhat iffy in the modern world.
>> We are relying on the fact that while Git is operating in this mode
>> of reading a tuple of commits per line and doing log-tree, that Git
>> itself will not do the history traversal (instead, another instance
>> of Git that feeds us via our standard input is walking the history)
>> for this piece of code to work correctly.
>>
>> Of course, the "diff-tree --stdin" command was meant to sit on the
>> downstream of "rev-list --parents", so the assumption the code makes
>> (i.e. the parents field of the in-core commit objects do not have to
>> be usable for history traversal) may be reasonable, but still...
>
> I'm not sure it's that weird. "diff-tree" is about diffing, not
> traversal. The only reason it touches commit->parents at all (and
> doesn't just kick off a diff between the arguments it gets) is that it's
> been stuck with pretty-printing the commits, which might ask to show the
> parents.
Yeah, I understand all that as 45392a648d ("git-diff-tree --stdin:
show all parents.", 2006-02-05) was mostly mine. It's just I sense
that the recent trend is to take whatever existing code and see if
they are reusable in other contexts, and this is one of the things
that people might want to libify, but cannot be as-is.
^ permalink raw reply
* Re: [PATCH v5 03/19] builtin/diff-tree: convert to struct object_id
From: Jeff King @ 2017-02-22 19:16 UTC (permalink / raw)
To: Junio C Hamano; +Cc: brian m. carlson, git, Michael Haggerty, Ramsay Jones
In-Reply-To: <xmqqy3wyawlu.fsf@gitster.mtv.corp.google.com>
On Wed, Feb 22, 2017 at 10:50:21AM -0800, Junio C Hamano wrote:
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
>
> > Convert most leaf functions to struct object_id. Change several
> > hardcoded numbers to uses of parse_oid_hex. In doing so, verify that we
> > when we want two trees, we have exactly two trees.
> >
> > Finally, in stdin_diff_commit, avoid accessing the byte after the NUL.
> > This will be a NUL as well, since the first NUL was a newline we
> > overwrote. However, with parse_oid_hex, we no longer need to increment
> > the pointer directly, and can simply increment it as part of our check
> > for the space character.
>
> After reading the pre- and post-image twice, I think I convinced
> myself that this is a faithful conersion and they do the same thing.
I think this is correct, too (but then, I think it largely comes from
the patch I wrote the other night. So I did look at it carefully, but
it's not exactly an independent review).
> What the function does appears somewhat iffy in the modern world.
> We are relying on the fact that while Git is operating in this mode
> of reading a tuple of commits per line and doing log-tree, that Git
> itself will not do the history traversal (instead, another instance
> of Git that feeds us via our standard input is walking the history)
> for this piece of code to work correctly.
>
> Of course, the "diff-tree --stdin" command was meant to sit on the
> downstream of "rev-list --parents", so the assumption the code makes
> (i.e. the parents field of the in-core commit objects do not have to
> be usable for history traversal) may be reasonable, but still...
I'm not sure it's that weird. "diff-tree" is about diffing, not
traversal. The only reason it touches commit->parents at all (and
doesn't just kick off a diff between the arguments it gets) is that it's
been stuck with pretty-printing the commits, which might ask to show the
parents.
-Peff
^ permalink raw reply
* Re: url.<base>.insteadOf vs. submodules
From: Stefan Beller @ 2017-02-22 19:11 UTC (permalink / raw)
To: Jeff King; +Cc: Junio C Hamano, Jon Loeliger, Toolforger, git@vger.kernel.org
In-Reply-To: <20170222185711.2kpzeypptg6deytc@sigill.intra.peff.net>
On Wed, Feb 22, 2017 at 10:57 AM, Jeff King <peff@peff.net> wrote:
> On Wed, Feb 22, 2017 at 09:36:12AM -0800, Junio C Hamano wrote:
>
>> >> My gut feeling is that we should do the selective/filtered include
>> >> Peff mentioned when a repository is known to be used as a submodule
>> >> of somebody else.
>> >
>> > Does the management of these submodue-related config values
>> > become easier if, instead of placing them in .config, we
>> > place them in a git/.context file?
>>
>> Do you mean that Git users that use submodules adopt a convention
>> where a separate file in $GIT_DIR of the toplevel superproject holds
>> pieces of configuration that are meant to be shared between the
>> superproject and across all its submodules, and the $GIT_DIR/config
>> file in submodules and the superproject all include that shared one
>> via include.path mechanism?
>>
>> That may allow us to do without being responsible for sifting of
>> configuration variables into safe and unsafe bins.
>>
>> I dunno.
>
> Hmm. I certainly like that we punt on having to decide on the "should
> this be shared with submodules" decision. That makes the end result more
> flexible, and we don't have to get into a never-ending stream of
> "whitelist this config option" patches.
>
> My only concern is that it's not as discoverable. In the situation that
> kicked off this thread, somebody put url.X.insteadOf into their
> super-project .git/config, expecting it to work in the submodules. That
> _still_ wouldn't work with this proposal. They'd have to:
>
> 1. Put it in .git/context (or whatever we call it)
>
> 2. Maybe add include.path=context in .git/config if they want the
> config shared with the super-project (or this could be automatic?)
>
> I guess it gives _a_ solution, which is more than we have now, but it
> doesn't feel very ergonomic.
Well, currently ".git/config" is the one and only blessed way to configure
a single repo and our documentation and user expectations reflect that.
Once git-worktree takes off (which has per working tree configuration files)
it doesn't feel as obscure anymore to have multiple config files.
The working trees will share the $GIT_COMMON_DIR/config file for
all working trees and have its own config file at $GIT_DIR/config.worktree
in its respective git directories. C.f.
https://public-inbox.org/git/20170110112524.12870-2-pclouds@gmail.com/
So I could imagine that we just introduce another config file
config.submodules which is source'd by the submodules.
Then the hard part becomes to decide which config value to put
in which config file. (We'd still be left to guess where to put some initial
new configuration value. config or config.submodules. Any update of a
value can just stay in its respective file. And I don't think we'd want
to invent a config option that tells us which policy we use where to
put config options. That sounds just scary.)
^ permalink raw reply
* Re: url.<base>.insteadOf vs. submodules
From: Jeff King @ 2017-02-22 18:57 UTC (permalink / raw)
To: Junio C Hamano
Cc: Jon Loeliger, Stefan Beller, Toolforger, git@vger.kernel.org
In-Reply-To: <xmqqh93mcelv.fsf@gitster.mtv.corp.google.com>
On Wed, Feb 22, 2017 at 09:36:12AM -0800, Junio C Hamano wrote:
> >> My gut feeling is that we should do the selective/filtered include
> >> Peff mentioned when a repository is known to be used as a submodule
> >> of somebody else.
> >
> > Does the management of these submodue-related config values
> > become easier if, instead of placing them in .config, we
> > place them in a git/.context file?
>
> Do you mean that Git users that use submodules adopt a convention
> where a separate file in $GIT_DIR of the toplevel superproject holds
> pieces of configuration that are meant to be shared between the
> superproject and across all its submodules, and the $GIT_DIR/config
> file in submodules and the superproject all include that shared one
> via include.path mechanism?
>
> That may allow us to do without being responsible for sifting of
> configuration variables into safe and unsafe bins.
>
> I dunno.
Hmm. I certainly like that we punt on having to decide on the "should
this be shared with submodules" decision. That makes the end result more
flexible, and we don't have to get into a never-ending stream of
"whitelist this config option" patches.
My only concern is that it's not as discoverable. In the situation that
kicked off this thread, somebody put url.X.insteadOf into their
super-project .git/config, expecting it to work in the submodules. That
_still_ wouldn't work with this proposal. They'd have to:
1. Put it in .git/context (or whatever we call it)
2. Maybe add include.path=context in .git/config if they want the
config shared with the super-project (or this could be automatic?)
I guess it gives _a_ solution, which is more than we have now, but it
doesn't feel very ergonomic.
-Peff
^ permalink raw reply
* Re: [PATCH v5 03/19] builtin/diff-tree: convert to struct object_id
From: Junio C Hamano @ 2017-02-22 18:50 UTC (permalink / raw)
To: brian m. carlson; +Cc: git, Jeff King, Michael Haggerty, Ramsay Jones
In-Reply-To: <20170221234737.894681-4-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> Convert most leaf functions to struct object_id. Change several
> hardcoded numbers to uses of parse_oid_hex. In doing so, verify that we
> when we want two trees, we have exactly two trees.
>
> Finally, in stdin_diff_commit, avoid accessing the byte after the NUL.
> This will be a NUL as well, since the first NUL was a newline we
> overwrote. However, with parse_oid_hex, we no longer need to increment
> the pointer directly, and can simply increment it as part of our check
> for the space character.
After reading the pre- and post-image twice, I think I convinced
myself that this is a faithful conersion and they do the same thing.
What the function does appears somewhat iffy in the modern world.
We are relying on the fact that while Git is operating in this mode
of reading a tuple of commits per line and doing log-tree, that Git
itself will not do the history traversal (instead, another instance
of Git that feeds us via our standard input is walking the history)
for this piece of code to work correctly.
Of course, the "diff-tree --stdin" command was meant to sit on the
downstream of "rev-list --parents", so the assumption the code makes
(i.e. the parents field of the in-core commit objects do not have to
be usable for history traversal) may be reasonable, but still...
^ permalink raw reply
* [PATCH] git add -i: replace \t with blanks in the help message
From: Ralf Thielow @ 2017-02-22 18:46 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jiang Xin, Ralf Thielow
Within the help message of 'git add -i', the 'diff' command uses one
tab character and blanks to create the space between the name and the
description while the others use blanks only. So if the tab size is
not at 4 characters, this description will not be in range.
Replace the tab character with blanks.
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
---
git-add--interactive.perl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index cf6fc926a..982593c89 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1678,7 +1678,7 @@ status - show paths with changes
update - add working tree state to the staged set of changes
revert - revert staged set of changes back to the HEAD version
patch - pick hunks and update selectively
-diff - view diff between HEAD and index
+diff - view diff between HEAD and index
add untracked - add contents of untracked files to the staged set of changes
EOF
}
--
2.12.0.rc2.424.g63d3652c7
^ permalink raw reply related
* Re: [PATCH 03/15] lib-submodule-update.sh: define tests for recursing into submodules
From: Stefan Beller @ 2017-02-22 18:43 UTC (permalink / raw)
To: Junio C Hamano
Cc: git@vger.kernel.org, brian m. carlson, Jonathan Nieder,
Brandon Williams
In-Reply-To: <xmqqlgt5x430.fsf@gitster.mtv.corp.google.com>
On Thu, Feb 16, 2017 at 12:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Stefan Beller <sbeller@google.com> writes:
>
>> Currently lib-submodule-update.sh provides 2 functions
>> test_submodule_switch and test_submodule_forced_switch that are used by a
>> variety of tests to ensure that submodules behave as expected. The current
>> expected behavior is that submodules are not touched at all (see
>> 42639d2317a for the exact setup).
>>
>> In the future we want to teach all these commands to properly recurse
>> into submodules. To do that, we'll add two testing functions to
>> submodule-update-lib.sh test_submodule_switch_recursing and
>> test_submodule_forced_switch_recursing.
>
> I'd remove "properly" and insert a colon after "add two ... to
> submodule-update-lib.sh" before the names of two functions.
ok
>
>> +reset_work_tree_to_interested () {
>> + reset_work_tree_to $1 &&
>> + # indicate we are interested in the submodule:
>> + git -C submodule_update config submodule.sub1.url "bogus" &&
>> + # also have it available:
>> + if ! test -d submodule_update/.git/modules/sub1
>> + then
>> + mkdir submodule_update/.git/modules &&
>
> Would we want "mkdir -p" here to be safe?
Yes I cannot think of a downside of being overly cautious here.
>
>> + cp -r submodule_update_repo/.git/modules/sub1 submodule_update/.git/modules/sub1
>
> ... ahh, wouldn't matter that much, we checked that modules/sub1
> does not exist, and as long as nobody creates modules/ or modules/somethingelse
> we are OK.
Well, I'll add the -p
>> +# Test that submodule contents are correctly updated when switching
>> +# between commits that change a submodule.
>> +# Test that the following transitions are correctly handled:
>> +# (These tests are also above in the case where we expect no change
>> +# in the submodule)
>> +# - Updated submodule
>> +# - New submodule
>> +# - Removed submodule
>> +# - Directory containing tracked files replaced by submodule
>> +# - Submodule replaced by tracked files in directory
>> +# - Submodule replaced by tracked file with the same name
>> +# - tracked file replaced by submodule
>
> These should work without trouble only when the paths involved in
> the operation in the working tree are clean, right? Just double
> checking. If they are dirty we should expect a failure, instead of
> silent loss of information.
yes, I'll go over the tests again and add those cases if missing.
>> + command="$1"
>
> The dq-pair is not strictly needed on the RHS of the assignment, but
> it is a good way to signal that we considered that we might receive
> an argument with $IFS in it...
>
>> + $command add_sub1 &&
>
> ... and after doing so, not quoting $command here signals that we
> expect command line splitting to happen. Am I reading it correctly?
> Without an actual caller appearing in this step, it is rather hard
> to judge.
>
I followed the existing code without thinking about these points, but they are
valid and exactly how we'd expect the code to behave.
$1 / $command will be e.g. "git checkout --recurse-submodules" in
this patch series; but later on we could also have functions.
C.f. t4137 which defines a function
apply_3way () {
git diff --ignore-submodules=dirty "..$1" | git apply --3way -
}
test_submodule_switch "apply_3way"
We'd want to have a similar thing for the recursing part, e.g.
apply_3way_recursing () {
git diff --submodule=diff "..$1" | git apply
--recurse-submodules --3way -
}
test_submodule_switch_recursing "apply_3way_recursing"
>> + echo sub1 > .git/info/exclude
>
> ">.git/info/exclude"
ok
^ permalink raw reply
* Re: [PATCH] Documentation: use brackets for optional arguments
From: Junio C Hamano @ 2017-02-22 18:21 UTC (permalink / raw)
To: brian m. carlson; +Cc: git
In-Reply-To: <20170222122546.922199-1-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> The documentation for git blame used vertical bars for optional
> arguments to -M and -C, which is unusual and potentially confusing.
> Since most man pages use brackets for optional items, and that's
> consistent with how we document the same options for git diff and
> friends, use brackets here, too.
This seems to date back to April 2007 X-<.
Thanks.
>
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
> Documentation/blame-options.txt | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt
> index 2669b87c9d..dc41957afa 100644
> --- a/Documentation/blame-options.txt
> +++ b/Documentation/blame-options.txt
> @@ -77,7 +77,7 @@ include::line-range-format.txt[]
> terminal. Can't use `--progress` together with `--porcelain`
> or `--incremental`.
>
> --M|<num>|::
> +-M[<num>]::
> Detect moved or copied lines within a file. When a commit
> moves or copies a block of lines (e.g. the original file
> has A and then B, and the commit changes it to B and then
> @@ -93,7 +93,7 @@ alphanumeric characters that Git must detect as moving/copying
> within a file for it to associate those lines with the parent
> commit. The default value is 20.
>
> --C|<num>|::
> +-C[<num>]::
> In addition to `-M`, detect lines moved or copied from other
> files that were modified in the same commit. This is
> useful when you reorganize your program and move code
^ permalink raw reply
* Re: [PATCH v5 01/24] refs.h: add forward declaration for structs used in this file
From: Stefan Beller @ 2017-02-22 18:18 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy
Cc: git@vger.kernel.org, Junio C Hamano, Michael Haggerty,
Johannes Schindelin, Ramsay Jones, David Turner
In-Reply-To: <20170222140450.30886-2-pclouds@gmail.com>
On Wed, Feb 22, 2017 at 6:04 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> refs.h | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/refs.h b/refs.h
> index 9fbff90e7..c494b641a 100644
> --- a/refs.h
> +++ b/refs.h
> @@ -1,6 +1,11 @@
> #ifndef REFS_H
> #define REFS_H
>
> +struct object_id;
> +struct ref_transaction;
> +struct strbuf;
> +struct string_list;
> +
> /*
> * Resolve a reference, recursively following symbolic refererences.
> *
> @@ -144,7 +149,6 @@ int dwim_log(const char *str, int len, unsigned char *sha1, char **ref);
> * `ref_transaction_commit` is called. So `ref_transaction_verify`
> * won't report a verification failure until the commit is attempted.
> */
> -struct ref_transaction;
Leaving the detailed comment about ref_transaction dangling?
I can understand if you don't want to move it with the declaration,
as you want all declarations terse in a few lines.
Maybe move the comment to be part of the first large comment
(The one that you can see in the first hunk, starting with
" * Resolve a reference, recursively following")
Maybe Michael has a better idea how to make this comment
more accessible to the casual refs-reader.
Thanks,
Stefan
^ permalink raw reply
* Re: [PATCH] Documentation: correctly spell git worktree --detach
From: Junio C Hamano @ 2017-02-22 17:50 UTC (permalink / raw)
To: brian m. carlson; +Cc: git, Casey Rodarmor
In-Reply-To: <20170222123442.923694-1-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> The option is “--detach”, but we accidentally spelled it “--detached” at
> one point in the man page.
>
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> Reported-by: Casey Rodarmor <casey@rodarmor.com>
> ---
Thanks, both.
> Documentation/git-worktree.txt | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
> index e257c19ebe..553cf8413f 100644
> --- a/Documentation/git-worktree.txt
> +++ b/Documentation/git-worktree.txt
> @@ -52,7 +52,7 @@ is linked to the current repository, sharing everything except working
> directory specific files such as HEAD, index, etc. `-` may also be
> specified as `<branch>`; it is synonymous with `@{-1}`.
> +
> -If `<branch>` is omitted and neither `-b` nor `-B` nor `--detached` used,
> +If `<branch>` is omitted and neither `-b` nor `-B` nor `--detach` used,
> then, as a convenience, a new branch based at HEAD is created automatically,
> as if `-b $(basename <path>)` was specified.
>
^ permalink raw reply
* Re: url.<base>.insteadOf vs. submodules
From: Junio C Hamano @ 2017-02-22 17:36 UTC (permalink / raw)
To: Jon Loeliger; +Cc: Stefan Beller, Jeff King, Toolforger, git@vger.kernel.org
In-Reply-To: <E1cgXSe-0007jp-QI@mylo.jdl.com>
Jon Loeliger <jdl@jdl.com> writes:
> So, like, Junio C Hamano said:
>> Stefan Beller <sbeller@google.com> writes:
>>
>> > Do we want to invent a special value for url.*.insteadOf to mean
>> > "look up in superproject, so I don't have to keep
>> > a copy that may get stale" ?
>>
>> My gut feeling is that we should do the selective/filtered include
>> Peff mentioned when a repository is known to be used as a submodule
>> of somebody else.
>
> Does the management of these submodue-related config values
> become easier if, instead of placing them in .config, we
> place them in a git/.context file?
Do you mean that Git users that use submodules adopt a convention
where a separate file in $GIT_DIR of the toplevel superproject holds
pieces of configuration that are meant to be shared between the
superproject and across all its submodules, and the $GIT_DIR/config
file in submodules and the superproject all include that shared one
via include.path mechanism?
That may allow us to do without being responsible for sifting of
configuration variables into safe and unsafe bins.
I dunno.
^ 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