* Re: [PATCH 2/7] Undocument deprecated alias 'push.default=tracking'
From: Junio C Hamano @ 2013-01-31 20:21 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Ævar Arnfjörð Bjarmason, Matthieu Moy, git,
Jeff King, Michael Haggerty
In-Reply-To: <20130131200434.GI27340@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
> Junio C Hamano wrote:
>
>> For those who
>> want to _learn_ what possibilities are available to them (i.e. they
>> are not going from `tracking` to what it means, but going in the
>> opposite direction), it should be unmistakingly clear that
>> `tracking` is not a part of the choices they should make.
>
> Until pre-1.7.4 versions of git fall out of use, I don't agree that
> the above is true. :(
The documentation ships with the version that the above is true. We
are not making an update to documentation that comes with ancient
versions.
>> I do not
>> think the following list created by a simple "revert" makes it clear.
>>
>> * `nothing` - do not push anything.
>> * `matching` - push all branches having the same name in both ends.
>> * `upstream` - push the current branch to ...
>> * `simple` - like `upstream`, but refuses to ...
>> * `tracking` - deprecated synonym for `upstream`.
>> * `current` - push the current branch to a branch of the same name.
>
> How about the following?
>
> * `nothing` - ...
> * `matching` - ...
> * `upstream` - ...
> * `simple` - ...
> * `current` - ...
>
> For compatibility with ancient config files, the following synonym
> is also supported. Don't use it.
>
> * `tracking` - old name for `upstream`
Didn't I say I am fine to mention it "as a side note" in the
original message you started responding to?
^ permalink raw reply
* Re: [PATCH] gitremote-helpers.txt: rename from git-remote-helpers.txt
From: Junio C Hamano @ 2013-01-31 20:36 UTC (permalink / raw)
To: Matthieu Moy; +Cc: John Keeping, git, Max Horn
In-Reply-To: <vpqpq0lw1ge.fsf@grenoble-inp.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> John Keeping <john@keeping.me.uk> writes:
>
>> Would we want to do something to avoid breaking links to the existing
>> document as well?
>
> That would be nice to add a new git-remote-helpers.txt saying "document
> has moved, see linkgit:gitremote-helpers.txt[1], so that HTML links to
> http://git-scm.com/docs/git-remote-helpers and friends do not get
> broken, yes.
Yeah, John's patch fixes internal links, but this will make links
from other sites stale. Adding to our installation rule to put a
handcrafted HTML page that says "The document moved here; please let
the owners of the referring site to know so that they can update the
link you clicked to get here" would be appropriate, I think.
^ permalink raw reply
* Re: [PATCH 2/7] Undocument deprecated alias 'push.default=tracking'
From: Philip Oakley @ 2013-01-31 20:41 UTC (permalink / raw)
To: Jonathan Nieder, Junio C Hamano
Cc: Ævar Arnfjörð Bjarmason, Matthieu Moy, git,
Jeff King, Michael Haggerty
In-Reply-To: <20130131200434.GI27340@google.com>
From: "Jonathan Nieder" <jrnieder@gmail.com>
Sent: Thursday, January 31, 2013 8:04 PM
> Junio C Hamano wrote:
>
>> For those who
>> want to _learn_ what possibilities are available to them (i.e. they
>> are not going from `tracking` to what it means, but going in the
>> opposite direction), it should be unmistakingly clear that
>> `tracking` is not a part of the choices they should make.
>
> Until pre-1.7.4 versions of git fall out of use, I don't agree that
> the above is true. :(
>
>
>> I do not
>> think the following list created by a simple "revert" makes it clear.
>>
>> * `nothing` - do not push anything.
>> * `matching` - push all branches having the same name in both
>> ends.
>> * `upstream` - push the current branch to ...
>> * `simple` - like `upstream`, but refuses to ...
>> * `tracking` - deprecated synonym for `upstream`.
>From a simple user perspective, I'd simply place it, in brackets and at
the end of the list.
e.g. [* `tracking` - deprecated synonym for `upstream`.]
The leading bracket makes it obvious that it's different, and that the
description needs to be read, rather than folk simply re-using a half
remembered option, gleaned from an old blog.
However formatting the leading bracket may not be as easy as the plain
text version.
>> * `current` - push the current branch to a branch of the same
>> name.
>
> How about the following?
>
> * `nothing` - ...
> * `matching` - ...
> * `upstream` - ...
> * `simple` - ...
> * `current` - ...
>
> For compatibility with ancient config files, the following synonym
> is also supported. Don't use it.
>
> * `tracking` - old name for `upstream`
? s/old/deprecated/ or s/old/outdated/ for those who don't understand
the jargon.
^ permalink raw reply
* Re: [PATCH 2/7] Undocument deprecated alias 'push.default=tracking'
From: Junio C Hamano @ 2013-01-31 20:42 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Ævar Arnfjörð Bjarmason, Matthieu Moy, git,
Jeff King, Michael Haggerty
In-Reply-To: <20130131201144.GJ27340@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
> Am I really the only one that doesn't see the "--print" change as
> hiding an option and sees burying "tracking" in the text as
> qualitatively different?
Sorry, but I do not understand the question.
We are hiding/burying the "--print" option to make it clear that it
is not a member with the same footing as others belonging to the
group of options to the command. It is accepted, but there is no
reason for the user to choose it over --normalize.
We want to make sure that "tracking" does not appear as if it is a
member of the pull.default set with equal rights as others. It is
accepted, but there is no reason for the user to choose it over
"upstream".
^ permalink raw reply
* Re: [PATCH 2/7] Undocument deprecated alias 'push.default=tracking'
From: Junio C Hamano @ 2013-01-31 20:44 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Ævar Arnfjörð Bjarmason, Matthieu Moy, git,
Jeff King, Michael Haggerty
In-Reply-To: <7vwqutf5jv.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>
>> Am I really the only one that doesn't see the "--print" change as
>> hiding an option and sees burying "tracking" in the text as
>> qualitatively different?
>
> Sorry, but I do not understand the question.
>
> We are hiding/burying the "--print" option to make it clear that it
> is not a member with the same footing as others belonging to the
> group of options to the command. It is accepted, but there is no
> reason for the user to choose it over --normalize.
>
> We want to make sure that "tracking" does not appear as if it is a
> member of the pull.default set with equal rights as others. It is
> accepted, but there is no reason for the user to choose it over
> "upstream".
Now I re-read the proposed update, I think it is an improvement over
a straight revert in that it makes it clear that 'tracking' does not
belong, but I still think it is better to make it a sidenote to the
'upstream'. It makes the connection between the two stronger.
^ permalink raw reply
* Re: [PATCH 2/7] Undocument deprecated alias 'push.default=tracking'
From: Junio C Hamano @ 2013-01-31 20:50 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Ævar Arnfjörð Bjarmason, Matthieu Moy, git,
Jeff King, Michael Haggerty
In-Reply-To: <7v622dgl2o.fsf@alter.siamese.dyndns.org>
How about doing it this way? I do not think anything that is
deprecated even deserves a separate section and "do not use it!"
heading.
-- >8 --
When looking at a configuration file edited long time ago, a user
may find 'pull.default = tracking' and wonder what it means.
Instead of not mentioning it, add it to the description in a way
that makes it clear that users have no reason to add new uses of it
preferring over 'upstream'.
Documentation/config.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index d7ec507..8441050 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1795,7 +1795,8 @@ push.default::
+
This is currently the default, but Git 2.0 will change the default
to `simple`.
-* `upstream` - push the current branch to its upstream branch.
+* `upstream` - push the current branch to its upstream branch
+ (`tracking` is a deprecated synonym for this).
With this, `git push` will update the same remote ref as the one which
is merged by `git pull`, making `push` and `pull` symmetrical.
See "branch.<name>.merge" for how to configure the upstream branch.
^ permalink raw reply related
* Re: [PATCH 2/7] Undocument deprecated alias 'push.default=tracking'
From: Jonathan Nieder @ 2013-01-31 21:00 UTC (permalink / raw)
To: Junio C Hamano
Cc: Ævar Arnfjörð Bjarmason, Matthieu Moy, git,
Jeff King, Michael Haggerty
In-Reply-To: <7vobg5f55t.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> How about doing it this way?
[...]
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -1795,7 +1795,8 @@ push.default::
> +
> This is currently the default, but Git 2.0 will change the default
> to `simple`.
> -* `upstream` - push the current branch to its upstream branch.
> +* `upstream` - push the current branch to its upstream branch
> + (`tracking` is a deprecated synonym for this).
I have already explained that I believe this is a bad idea and why and
proposed an alternative. I take it that either we are
miscommunicating or we fundamentally disagree about the role of
documentation. :(
^ permalink raw reply
* Re: [PATCH 2/7] Undocument deprecated alias 'push.default=tracking'
From: Jonathan Nieder @ 2013-01-31 21:08 UTC (permalink / raw)
To: Junio C Hamano
Cc: Ævar Arnfjörð Bjarmason, Matthieu Moy, git,
Jeff King, Michael Haggerty
In-Reply-To: <7v622dgl2o.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> Junio C Hamano wrote:
>>> For those who
>>> want to _learn_ what possibilities are available to them (i.e. they
>>> are not going from `tracking` to what it means, but going in the
>>> opposite direction), it should be unmistakingly clear that
>>> `tracking` is not a part of the choices they should make.
>>
>> Until pre-1.7.4 versions of git fall out of use, I don't agree that
>> the above is true. :(
>
> The documentation ships with the version that the above is true. We
> are not making an update to documentation that comes with ancient
> versions.
Part of the context that I should have mentioned but didn't is that it
is common to put $HOME on a shared filesystem.
[...]
>> How about the following?
>>
>> * `nothing` - ...
>> * `matching` - ...
>> * `upstream` - ...
>> * `simple` - ...
>> * `current` - ...
>>
>> For compatibility with ancient config files, the following synonym
>> is also supported. Don't use it.
>>
>> * `tracking` - old name for `upstream`
>
> Didn't I say I am fine to mention it "as a side note" in the
> original message you started responding to?
Yes, I understood what you were proposing and I directly disagreed
with it and explained why.
The above is something like a compromise --- more precisely, it is an
attempt to do something better than a straight revert and to
understand whether it would address your objection. Clearly it
doesn't. I don't understand why.
Perhaps the "Don't use it" is over the top and that is your complaint?
It's true that if I were writing it without your objection in mind, I
wouldn't have included that sentence. It was written on the
assumption that you want to discourage people from using the
"tracking" synonym --- I am not personally convinced that that is
worth discouraging at all, but it's fine with me if the consensus is
to do so.
Jonathan
^ permalink raw reply
* [PATCH] Rename {git- => git}remote-helpers.txt
From: John Keeping @ 2013-01-31 21:59 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Matthieu Moy, Max Horn, John Keeping
In-Reply-To: <7v1ud1gke7.fsf@alter.siamese.dyndns.org>
When looking up a topic via "git help <topic>", git-help prepends "git-"
to topics that are the names of commands (either builtin or found on the
path) and "git" (no hyphen) to any other topic name.
"git-remote-helpers" is not the name of a command, so "git help
remote-helpers" looks for "gitremote-helpers" and does not find it.
Fix this by renaming "git-remote-helpers.txt" to
"gitremote-helpers.txt".
Signed-off-by: John Keeping <john@keeping.me.uk>
---
Changes since v1:
- add gitremote-helpers.txt to the Makefile since it is no longer caught
by git-*.txt.
- add a simple git-remote-helpers.html to help people following links to
the old name.
Documentation/.gitignore | 1 +
Documentation/Makefile | 4 +-
Documentation/git-remote-helpers.html | 55 ++++++++++++++++++++++
Documentation/git-remote-testgit.txt | 2 +-
...it-remote-helpers.txt => gitremote-helpers.txt} | 6 +--
Documentation/urls.txt | 2 +-
6 files changed, 63 insertions(+), 7 deletions(-)
create mode 100644 Documentation/git-remote-helpers.html
rename Documentation/{git-remote-helpers.txt => gitremote-helpers.txt} (99%)
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
index 2c8b2d6..5f479b8 100644
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -1,5 +1,6 @@
*.xml
*.html
+!git-remote-helpers.html
*.[1-8]
*.made
*.texi
diff --git a/Documentation/Makefile b/Documentation/Makefile
index fe6709c..4ccb828 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,7 +1,7 @@
MAN1_TXT= \
$(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
$(wildcard git-*.txt)) \
- gitk.txt gitweb.txt git.txt
+ gitk.txt gitweb.txt git.txt gitremote-helpers.txt
MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt githooks.txt \
gitrepository-layout.txt gitweb.conf.txt
MAN7_TXT=gitcli.txt gittutorial.txt gittutorial-2.txt \
@@ -13,7 +13,7 @@ MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)
MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT))
MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT))
-DOC_HTML=$(MAN_HTML)
+DOC_HTML=$(MAN_HTML) git-remote-helpers.html
ARTICLES = howto-index
ARTICLES += everyday
diff --git a/Documentation/git-remote-helpers.html b/Documentation/git-remote-helpers.html
new file mode 100644
index 0000000..0c5ec27
--- /dev/null
+++ b/Documentation/git-remote-helpers.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
+<title>git-remote-helpers(1) - Document Moved</title>
+<style type="text/css">
+/* Cut-down styles from asciidoc.css. */
+
+/* Default font. */
+body {
+ font-family: Georgia,serif;
+}
+
+/* Title font. */
+h1 {
+ font-family: Arial,Helvetica,sans-serif;
+}
+
+body {
+ margin: 1em 5% 1em 5%;
+}
+
+a {
+ color: blue;
+ text-decoration: underline;
+}
+a:visited {
+ color: fuchsia;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ color: #527bbd;
+ margin-top: 1.2em;
+ margin-bottom: 0.5em;
+ line-height: 1.3;
+}
+
+</style>
+</head>
+<body class="manpage">
+<div id="header">
+<h1>
+Document Moved
+</h1>
+</div>
+
+<p>This document is now called <a
+href="gitremote-helpers.html">gitremote-helpers</a>.</p>
+
+<p>Please let the owners of the referring site know so that they can update the
+link you clicked to get here.</p>
+
+</body>
+</html>
diff --git a/Documentation/git-remote-testgit.txt b/Documentation/git-remote-testgit.txt
index 612a625..f791d73 100644
--- a/Documentation/git-remote-testgit.txt
+++ b/Documentation/git-remote-testgit.txt
@@ -23,7 +23,7 @@ The best way to learn more is to read the comments and source code in
SEE ALSO
--------
-linkgit:git-remote-helpers[1]
+linkgit:gitremote-helpers[1]
GIT
---
diff --git a/Documentation/git-remote-helpers.txt b/Documentation/gitremote-helpers.txt
similarity index 99%
rename from Documentation/git-remote-helpers.txt
rename to Documentation/gitremote-helpers.txt
index e36fdcb..0c91aba 100644
--- a/Documentation/git-remote-helpers.txt
+++ b/Documentation/gitremote-helpers.txt
@@ -1,9 +1,9 @@
-git-remote-helpers(1)
-=====================
+gitremote-helpers(1)
+====================
NAME
----
-git-remote-helpers - Helper programs to interact with remote repositories
+gitremote-helpers - Helper programs to interact with remote repositories
SYNOPSIS
--------
diff --git a/Documentation/urls.txt b/Documentation/urls.txt
index 539c0a0..3ca122f 100644
--- a/Documentation/urls.txt
+++ b/Documentation/urls.txt
@@ -55,7 +55,7 @@ may be used:
where <address> may be a path, a server and path, or an arbitrary
URL-like string recognized by the specific remote helper being
-invoked. See linkgit:git-remote-helpers[1] for details.
+invoked. See linkgit:gitremote-helpers[1] for details.
If there are a large number of similarly-named remote repositories and
you want to use a different format for them (such that the URLs you
--
1.8.1.1
^ permalink raw reply related
* [PATCH] Verify Content-Type from smart HTTP servers
From: Junio C Hamano @ 2013-01-31 22:09 UTC (permalink / raw)
To: Shawn Pearce; +Cc: git
Before parsing a suspected smart-HTTP response verify the returned
Content-Type matches the standard. This protects a client from
attempting to process a payload that smells like a smart-HTTP
server response.
JGit has been doing this check on all responses since the dawn of
time. I mistakenly failed to include it in git-core when smart HTTP
was introduced. At the time I didn't know how to get the Content-Type
from libcurl. I punted, meant to circle back and fix this, and just
plain forgot about it.
Signed-off-by: Shawn Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
* The original was picked up by majordomo taboo rules; resending
after minor style fix.
Was there a report of an attempted attack by malicious server or
something that triggered this, or is this just a "common sense
thing to do" in general?
http-push.c | 4 ++--
http.c | 31 ++++++++++++++++++++++---------
http.h | 2 +-
remote-curl.c | 15 +++++++++++----
t/lib-httpd.sh | 1 +
t/lib-httpd/apache.conf | 4 ++++
t/lib-httpd/broken-smart-http.sh | 11 +++++++++++
t/t5551-http-fetch.sh | 6 ++++++
8 files changed, 58 insertions(+), 16 deletions(-)
create mode 100755 t/lib-httpd/broken-smart-http.sh
diff --git a/http-push.c b/http-push.c
index 8701c12..ba45b7b 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1560,7 +1560,7 @@ static int remote_exists(const char *path)
sprintf(url, "%s%s", repo->url, path);
- switch (http_get_strbuf(url, NULL, 0)) {
+ switch (http_get_strbuf(url, NULL, NULL, 0)) {
case HTTP_OK:
ret = 1;
break;
@@ -1584,7 +1584,7 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)
url = xmalloc(strlen(repo->url) + strlen(path) + 1);
sprintf(url, "%s%s", repo->url, path);
- if (http_get_strbuf(url, &buffer, 0) != HTTP_OK)
+ if (http_get_strbuf(url, NULL, &buffer, 0) != HTTP_OK)
die("Couldn't get %s for remote symref\n%s", url,
curl_errorstr);
free(url);
diff --git a/http.c b/http.c
index 44f3525..d868d8b 100644
--- a/http.c
+++ b/http.c
@@ -788,7 +788,8 @@ int handle_curl_result(struct slot_results *results)
#define HTTP_REQUEST_STRBUF 0
#define HTTP_REQUEST_FILE 1
-static int http_request(const char *url, void *result, int target, int options)
+static int http_request(const char *url, struct strbuf *type,
+ void *result, int target, int options)
{
struct active_request_slot *slot;
struct slot_results results;
@@ -838,24 +839,36 @@ static int http_request(const char *url, void *result, int target, int options)
ret = HTTP_START_FAILED;
}
+ if (type) {
+ char *t;
+ curl_easy_getinfo(slot->curl, CURLINFO_CONTENT_TYPE, &t);
+ if (t)
+ strbuf_addstr(type, t);
+ }
+
curl_slist_free_all(headers);
strbuf_release(&buf);
return ret;
}
-static int http_request_reauth(const char *url, void *result, int target,
+static int http_request_reauth(const char *url,
+ struct strbuf *type,
+ void *result, int target,
int options)
{
- int ret = http_request(url, result, target, options);
+ int ret = http_request(url, type, result, target, options);
if (ret != HTTP_REAUTH)
return ret;
- return http_request(url, result, target, options);
+ return http_request(url, type, result, target, options);
}
-int http_get_strbuf(const char *url, struct strbuf *result, int options)
+int http_get_strbuf(const char *url,
+ struct strbuf *type,
+ struct strbuf *result, int options)
{
- return http_request_reauth(url, result, HTTP_REQUEST_STRBUF, options);
+ return http_request_reauth(url, type, result,
+ HTTP_REQUEST_STRBUF, options);
}
/*
@@ -878,7 +891,7 @@ static int http_get_file(const char *url, const char *filename, int options)
goto cleanup;
}
- ret = http_request_reauth(url, result, HTTP_REQUEST_FILE, options);
+ ret = http_request_reauth(url, NULL, result, HTTP_REQUEST_FILE, options);
fclose(result);
if ((ret == HTTP_OK) && move_temp_to_file(tmpfile.buf, filename))
@@ -904,7 +917,7 @@ int http_fetch_ref(const char *base, struct ref *ref)
int ret = -1;
url = quote_ref_url(base, ref->name);
- if (http_get_strbuf(url, &buffer, HTTP_NO_CACHE) == HTTP_OK) {
+ if (http_get_strbuf(url, NULL, &buffer, HTTP_NO_CACHE) == HTTP_OK) {
strbuf_rtrim(&buffer);
if (buffer.len == 40)
ret = get_sha1_hex(buffer.buf, ref->old_sha1);
@@ -997,7 +1010,7 @@ int http_get_info_packs(const char *base_url, struct packed_git **packs_head)
strbuf_addstr(&buf, "objects/info/packs");
url = strbuf_detach(&buf, NULL);
- ret = http_get_strbuf(url, &buf, HTTP_NO_CACHE);
+ ret = http_get_strbuf(url, NULL, &buf, HTTP_NO_CACHE);
if (ret != HTTP_OK)
goto cleanup;
diff --git a/http.h b/http.h
index 0a80d30..25d1931 100644
--- a/http.h
+++ b/http.h
@@ -132,7 +132,7 @@ extern char *get_remote_object_url(const char *url, const char *hex,
*
* If the result pointer is NULL, a HTTP HEAD request is made instead of GET.
*/
-int http_get_strbuf(const char *url, struct strbuf *result, int options);
+int http_get_strbuf(const char *url, struct strbuf *content_type, struct strbuf *result, int options);
/*
* Prints an error message using error() containing url and curl_errorstr,
diff --git a/remote-curl.c b/remote-curl.c
index 9a8b123..e6f3b63 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -92,6 +92,8 @@ static void free_discovery(struct discovery *d)
static struct discovery* discover_refs(const char *service)
{
+ struct strbuf exp = STRBUF_INIT;
+ struct strbuf type = STRBUF_INIT;
struct strbuf buffer = STRBUF_INIT;
struct discovery *last = last_discovery;
char *refs_url;
@@ -113,7 +115,7 @@ static struct discovery* discover_refs(const char *service)
}
refs_url = strbuf_detach(&buffer, NULL);
- http_ret = http_get_strbuf(refs_url, &buffer, HTTP_NO_CACHE);
+ http_ret = http_get_strbuf(refs_url, &type, &buffer, HTTP_NO_CACHE);
switch (http_ret) {
case HTTP_OK:
break;
@@ -133,16 +135,19 @@ static struct discovery* discover_refs(const char *service)
last->buf = last->buf_alloc;
if (maybe_smart && 5 <= last->len && last->buf[4] == '#') {
- /* smart HTTP response; validate that the service
+ /*
+ * smart HTTP response; validate that the service
* pkt-line matches our request.
*/
- struct strbuf exp = STRBUF_INIT;
-
+ strbuf_addf(&exp, "application/x-%s-advertisement", service);
+ if (strbuf_cmp(&exp, &type))
+ die("invalid content-type %s", type.buf);
if (packet_get_line(&buffer, &last->buf, &last->len) <= 0)
die("%s has invalid packet header", refs_url);
if (buffer.len && buffer.buf[buffer.len - 1] == '\n')
strbuf_setlen(&buffer, buffer.len - 1);
+ strbuf_reset(&exp);
strbuf_addf(&exp, "# service=%s", service);
if (strbuf_cmp(&exp, &buffer))
die("invalid server response; got '%s'", buffer.buf);
@@ -160,6 +165,8 @@ static struct discovery* discover_refs(const char *service)
}
free(refs_url);
+ strbuf_release(&exp);
+ strbuf_release(&type);
strbuf_release(&buffer);
last_discovery = last;
return last;
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index 02f442b..895b925 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -80,6 +80,7 @@ fi
prepare_httpd() {
mkdir -p "$HTTPD_DOCUMENT_ROOT_PATH"
cp "$TEST_PATH"/passwd "$HTTPD_ROOT_PATH"
+ cp "$TEST_PATH"/broken-smart-http.sh "$HTTPD_ROOT_PATH"
ln -s "$LIB_HTTPD_MODULE_PATH" "$HTTPD_ROOT_PATH/modules"
diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index fe76e84..938b4cf 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -62,9 +62,13 @@ Alias /auth/dumb/ www/auth/dumb/
SetEnv GIT_COMMITTER_EMAIL custom@example.com
</LocationMatch>
ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1
+ScriptAlias /broken_smart/ broken-smart-http.sh/
<Directory ${GIT_EXEC_PATH}>
Options FollowSymlinks
</Directory>
+<Files broken-smart-http.sh>
+ Options ExecCGI
+</Files>
<Files ${GIT_EXEC_PATH}/git-http-backend>
Options ExecCGI
</Files>
diff --git a/t/lib-httpd/broken-smart-http.sh b/t/lib-httpd/broken-smart-http.sh
new file mode 100755
index 0000000..f7ebfff
--- /dev/null
+++ b/t/lib-httpd/broken-smart-http.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+printf "Content-Type: text/%s\n" "html"
+echo
+printf "%s\n" "001e# service=git-upload-pack"
+printf "%s" "0000"
+printf "%s%c%s%s\n" \
+ "00a58681d9f286a48b08f37b3a095330da16689e3693 HEAD" \
+ 0 \
+ " include-tag multi_ack_detailed multi_ack ofs-delta" \
+ " side-band side-band-64k thin-pack no-progress shallow no-done "
+printf "%s" "0000"
diff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh
index c5cd2e3..cb95b95 100755
--- a/t/t5551-http-fetch.sh
+++ b/t/t5551-http-fetch.sh
@@ -157,6 +157,12 @@ test_expect_success 'GIT_SMART_HTTP can disable smart http' '
test_must_fail git fetch)
'
+test_expect_success 'invalid Content-Type rejected' '
+ echo "fatal: invalid content-type text/html" >expect
+ test_must_fail git clone $HTTPD_URL/broken_smart/repo.git 2>actual
+ test_cmp expect actual
+'
+
test -n "$GIT_TEST_LONG" && test_set_prereq EXPENSIVE
test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '
--
1.8.1.2.605.gb99210a
^ permalink raw reply related
* Re: [PATCH] Rename {git- => git}remote-helpers.txt
From: Junio C Hamano @ 2013-01-31 22:13 UTC (permalink / raw)
To: John Keeping; +Cc: git, Matthieu Moy, Max Horn
In-Reply-To: <3f26b82599aa2a45897d345c851fab4751c55810.1359669205.git.john@keeping.me.uk>
John Keeping <john@keeping.me.uk> writes:
> When looking up a topic via "git help <topic>", git-help prepends "git-"
> to topics that are the names of commands (either builtin or found on the
> path) and "git" (no hyphen) to any other topic name.
>
> "git-remote-helpers" is not the name of a command, so "git help
> remote-helpers" looks for "gitremote-helpers" and does not find it.
>
> Fix this by renaming "git-remote-helpers.txt" to
> "gitremote-helpers.txt".
>
> Signed-off-by: John Keeping <john@keeping.me.uk>
>
> ---
> Changes since v1:
>
> - add gitremote-helpers.txt to the Makefile since it is no longer caught
> by git-*.txt.
>
> - add a simple git-remote-helpers.html to help people following links to
> the old name.
Doesn't "make clean" remove the placeholder file?
> Documentation/.gitignore | 1 +
> Documentation/Makefile | 4 +-
> Documentation/git-remote-helpers.html | 55 ++++++++++++++++++++++
> Documentation/git-remote-testgit.txt | 2 +-
> ...it-remote-helpers.txt => gitremote-helpers.txt} | 6 +--
> Documentation/urls.txt | 2 +-
> 6 files changed, 63 insertions(+), 7 deletions(-)
> create mode 100644 Documentation/git-remote-helpers.html
> rename Documentation/{git-remote-helpers.txt => gitremote-helpers.txt} (99%)
>
> diff --git a/Documentation/.gitignore b/Documentation/.gitignore
> index 2c8b2d6..5f479b8 100644
> --- a/Documentation/.gitignore
> +++ b/Documentation/.gitignore
> @@ -1,5 +1,6 @@
> *.xml
> *.html
> +!git-remote-helpers.html
> *.[1-8]
> *.made
> *.texi
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index fe6709c..4ccb828 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -1,7 +1,7 @@
> MAN1_TXT= \
> $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
> $(wildcard git-*.txt)) \
> - gitk.txt gitweb.txt git.txt
> + gitk.txt gitweb.txt git.txt gitremote-helpers.txt
> MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt githooks.txt \
> gitrepository-layout.txt gitweb.conf.txt
> MAN7_TXT=gitcli.txt gittutorial.txt gittutorial-2.txt \
> @@ -13,7 +13,7 @@ MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)
> MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT))
> MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT))
>
> -DOC_HTML=$(MAN_HTML)
> +DOC_HTML=$(MAN_HTML) git-remote-helpers.html
>
> ARTICLES = howto-index
> ARTICLES += everyday
> diff --git a/Documentation/git-remote-helpers.html b/Documentation/git-remote-helpers.html
> new file mode 100644
> index 0000000..0c5ec27
> --- /dev/null
> +++ b/Documentation/git-remote-helpers.html
> @@ -0,0 +1,55 @@
> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> + "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
> +<head>
> +<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
> +<title>git-remote-helpers(1) - Document Moved</title>
> +<style type="text/css">
> +/* Cut-down styles from asciidoc.css. */
> +
> +/* Default font. */
> +body {
> + font-family: Georgia,serif;
> +}
> +
> +/* Title font. */
> +h1 {
> + font-family: Arial,Helvetica,sans-serif;
> +}
> +
> +body {
> + margin: 1em 5% 1em 5%;
> +}
> +
> +a {
> + color: blue;
> + text-decoration: underline;
> +}
> +a:visited {
> + color: fuchsia;
> +}
> +
> +h1, h2, h3, h4, h5, h6 {
> + color: #527bbd;
> + margin-top: 1.2em;
> + margin-bottom: 0.5em;
> + line-height: 1.3;
> +}
> +
> +</style>
> +</head>
> +<body class="manpage">
> +<div id="header">
> +<h1>
> +Document Moved
> +</h1>
> +</div>
> +
> +<p>This document is now called <a
> +href="gitremote-helpers.html">gitremote-helpers</a>.</p>
> +
> +<p>Please let the owners of the referring site know so that they can update the
> +link you clicked to get here.</p>
> +
> +</body>
> +</html>
> diff --git a/Documentation/git-remote-testgit.txt b/Documentation/git-remote-testgit.txt
> index 612a625..f791d73 100644
> --- a/Documentation/git-remote-testgit.txt
> +++ b/Documentation/git-remote-testgit.txt
> @@ -23,7 +23,7 @@ The best way to learn more is to read the comments and source code in
>
> SEE ALSO
> --------
> -linkgit:git-remote-helpers[1]
> +linkgit:gitremote-helpers[1]
>
> GIT
> ---
> diff --git a/Documentation/git-remote-helpers.txt b/Documentation/gitremote-helpers.txt
> similarity index 99%
> rename from Documentation/git-remote-helpers.txt
> rename to Documentation/gitremote-helpers.txt
> index e36fdcb..0c91aba 100644
> --- a/Documentation/git-remote-helpers.txt
> +++ b/Documentation/gitremote-helpers.txt
> @@ -1,9 +1,9 @@
> -git-remote-helpers(1)
> -=====================
> +gitremote-helpers(1)
> +====================
>
> NAME
> ----
> -git-remote-helpers - Helper programs to interact with remote repositories
> +gitremote-helpers - Helper programs to interact with remote repositories
>
> SYNOPSIS
> --------
> diff --git a/Documentation/urls.txt b/Documentation/urls.txt
> index 539c0a0..3ca122f 100644
> --- a/Documentation/urls.txt
> +++ b/Documentation/urls.txt
> @@ -55,7 +55,7 @@ may be used:
>
> where <address> may be a path, a server and path, or an arbitrary
> URL-like string recognized by the specific remote helper being
> -invoked. See linkgit:git-remote-helpers[1] for details.
> +invoked. See linkgit:gitremote-helpers[1] for details.
>
> If there are a large number of similarly-named remote repositories and
> you want to use a different format for them (such that the URLs you
^ permalink raw reply
* Re: [PATCH] gitremote-helpers.txt: rename from git-remote-helpers.txt
From: Tomas Carnecky @ 2013-01-31 22:28 UTC (permalink / raw)
To: John Keeping, git; +Cc: Junio C Hamano, Max Horn, Matthieu Moy
In-Reply-To: <fc96ae61bb64ce19e856d7a1624e2130c99afd47.1359662569.git.john@keeping.me.uk>
On Thu, 31 Jan 2013 20:08:14 +0000, John Keeping <john@keeping.me.uk> wrote:
> This is the patch to rename it to "gitremote-helpers.txt".
>
> Documentation/{git-remote-helpers.txt => gitremote-helpers.txt} | 6 +++---
It feels somewhat weird to have 'git-remote' but 'gitremote-helpers'.
^ permalink raw reply
* Re: [PATCH] Rename {git- => git}remote-helpers.txt
From: John Keeping @ 2013-01-31 22:28 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Matthieu Moy, Max Horn
In-Reply-To: <7vy5f9dmrt.fsf@alter.siamese.dyndns.org>
On Thu, Jan 31, 2013 at 02:13:10PM -0800, Junio C Hamano wrote:
> John Keeping <john@keeping.me.uk> writes:
>
> > When looking up a topic via "git help <topic>", git-help prepends "git-"
> > to topics that are the names of commands (either builtin or found on the
> > path) and "git" (no hyphen) to any other topic name.
> >
> > "git-remote-helpers" is not the name of a command, so "git help
> > remote-helpers" looks for "gitremote-helpers" and does not find it.
> >
> > Fix this by renaming "git-remote-helpers.txt" to
> > "gitremote-helpers.txt".
> >
> > Signed-off-by: John Keeping <john@keeping.me.uk>
> >
> > ---
> > Changes since v1:
> >
> > - add gitremote-helpers.txt to the Makefile since it is no longer caught
> > by git-*.txt.
> >
> > - add a simple git-remote-helpers.html to help people following links to
> > the old name.
>
> Doesn't "make clean" remove the placeholder file?
Yes. Should I change it to "git-remote-helpers.html.in" and then copy
it into place? That seems like the simplest answer and means that
"*.html" will continue to refer only to generated files.
John
^ permalink raw reply
* Re: [PATCH] Rename {git- => git}remote-helpers.txt
From: Jeff King @ 2013-01-31 22:33 UTC (permalink / raw)
To: John Keeping; +Cc: git, Junio C Hamano, Matthieu Moy, Max Horn
In-Reply-To: <3f26b82599aa2a45897d345c851fab4751c55810.1359669205.git.john@keeping.me.uk>
On Thu, Jan 31, 2013 at 09:59:50PM +0000, John Keeping wrote:
> When looking up a topic via "git help <topic>", git-help prepends "git-"
> to topics that are the names of commands (either builtin or found on the
> path) and "git" (no hyphen) to any other topic name.
>
> "git-remote-helpers" is not the name of a command, so "git help
> remote-helpers" looks for "gitremote-helpers" and does not find it.
>
> Fix this by renaming "git-remote-helpers.txt" to
> "gitremote-helpers.txt".
Maybe it is just me, but the fact that accessing the manpage is now:
man gitremote-helpers
feels weird to me. I know it technically follows our syntactic rules,
but having the lack of dash be significant between "git" and "remote",
but then having a dash later makes it hard on the eyes.
Would it make more sense to just call it "gitremotehelpers", and then
access it as:
git help remotehelpers
or
man gitremotehelpers
?
That has it its own ugliness (two words run together), but at least my
version of man will accept arbitrary capitalization, allowing:
git help remoteHelpers
and
man gitremoteHelpers
I dunno.
-Peff
^ permalink raw reply
* Re: [PATCH 2/3] run-command: Be more informative about what failed
From: Jeff King @ 2013-01-31 22:35 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Stephen Boyd, git
In-Reply-To: <7vfw1hiami.fsf@alter.siamese.dyndns.org>
On Thu, Jan 31, 2013 at 08:24:21AM -0800, Junio C Hamano wrote:
> Stephen Boyd <sboyd@codeaurora.org> writes:
>
> > While debugging an error with verify_signed_buffer() the error
> > messages from run-command weren't very useful:
> >
> > error: cannot create pipe for gpg: Too many open files
> > error: could not run gpg.
> >
> > because they didn't indicate *which* pipe couldn't be created.
>
> For the message emitted here with your update (or without for that
> matter) to be useful, it has to hold that there is a single leaker,
> that leaker fails in this codepath, and that there is nobody else
> involved. Otherwise, you may be able to tell that one caller could
> not create its stdin, but the reason it couldn't may be because
> somebody else consumed all the available file descriptors.
>
> I am not opposed to this change per-se, but I am not sure that
> saying "stdin" etc. makes the message more useful for the purpose of
> debugging.
Yeah, I had the same feeling. All that failed is pipe(), which does not
have anything to do with what we are going to use the pipe for. So it
gives some context, perhaps, but does not necessarily tell us anything
useful.
But it is not much code, and sometimes it is surprising what information
can be helpful when debugging, so like you, I am not opposed, just
doubtful.
-Peff
^ permalink raw reply
* Re: [PATCH] Verify Content-Type from smart HTTP servers
From: Shawn Pearce @ 2013-01-31 22:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vd2wlf1zf.fsf@alter.siamese.dyndns.org>
On Thu, Jan 31, 2013 at 1:59 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Shawn Pearce <spearce@spearce.org> writes:
>
>> Before parsing a suspected smart-HTTP response verify the returned
>> Content-Type matches the standard. This protects a client from
>> attempting to process a payload that smells like a smart-HTTP
>> server response.
>>
>> JGit has been doing this check on all responses since the dawn of
>> time. I mistakenly failed to include it in git-core when smart HTTP
>> was introduced. At the time I didn't know how to get the Content-Type
>> from libcurl. I punted, meant to circle back and fix this, and just
>> plain forgot about it.
>>
>> Signed-off-by: Shawn Pearce <spearce@spearce.org>
>> ---
>
> Sounds sensible. Was there a report of attack attempts by malicious
> servers or something, or is it just a general "common sense" thing?
Common-sense cleanup.
I had a report a while ago about JGit not working with the Git servers
at Codeplex. This failure was caused by their HTTP servers returning
an invalid Content-Type, making JGit refuse to continue parsing. This
has since been fixed, I verified this morning that Codeplex is
returning the correct Content-Type.
^ permalink raw reply
* Re: [PATCHv2 1/3] gpg: Close stderr once finished with it in verify_signed_buffer()
From: Jeff King @ 2013-01-31 22:37 UTC (permalink / raw)
To: Stephen Boyd; +Cc: git
In-Reply-To: <1359656320-4434-1-git-send-email-sboyd@codeaurora.org>
On Thu, Jan 31, 2013 at 10:18:40AM -0800, Stephen Boyd wrote:
> Failing to close the stderr pipe in verify_signed_buffer() causes
> git to run out of file descriptors if there are many calls to
> verify_signed_buffer(). An easy way to trigger this is to run
>
> git log --show-signature --merges | grep "key"
>
> on the linux kernel git repo. Eventually it will fail with
>
> error: cannot create pipe for gpg: Too many open files
> error: could not run gpg.
>
> Close the stderr pipe so that this can't happen.
>
> Suggested-by: Jeff King <peff@peff.net>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Thanks, looks good to me (obviously :) ). The rest of the series looks
fine, too, with the caveat I mentioned on 2/3. Thanks for fixing this.
-Peff
^ permalink raw reply
* Re: [PATCH] Rename {git- => git}remote-helpers.txt
From: Junio C Hamano @ 2013-01-31 22:43 UTC (permalink / raw)
To: John Keeping; +Cc: git, Matthieu Moy, Max Horn
In-Reply-To: <20130131222817.GP1342@serenity.lan>
John Keeping <john@keeping.me.uk> writes:
> Yes. Should I change it to "git-remote-helpers.html.in" and then copy
> it into place? That seems like the simplest answer and means that
> "*.html" will continue to refer only to generated files.
I'd like to see if we can have a way to keep its look as the default
css gets updated without maintainance burden.
How about using AsciiDoc instead of "cp", perhaps like this on top
of your patch?
Documentation/.gitignore | 1 -
Documentation/Makefile | 9 +++++-
Documentation/git-remote-helpers.txto | 26 +++++++++++++++++
Documentation/git-remote-helpers.html | 55 -----------------------------------
4 files changed, 34 insertions(+), 57 deletions(-)
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
index 4685378..d62aebd 100644
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -1,6 +1,5 @@
*.xml
*.html
-!git-remote-helpers.html
*.[1-8]
*.made
*.texi
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 13e0098..fa2f9f9 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -13,7 +13,8 @@ MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)
MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT))
MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT))
-DOC_HTML=$(MAN_HTML) git-remote-helpers.html
+OBSOLETE_HTML = git-remote-helpers.html
+DOC_HTML=$(MAN_HTML) $(OBSOLETE_HTML)
ARTICLES = howto-index
ARTICLES += everyday
@@ -261,6 +262,12 @@ $(MAN_HTML): %.html : %.txt asciidoc.conf
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
mv $@+ $@
+$(OBSOLETE_HTML): %.html : %.txto asciidoc.conf
+ $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
+ $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
+ $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
+ mv $@+ $@
+
manpage-base-url.xsl: manpage-base-url.xsl.in
sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
diff --git a/Documentation/git-remote-helpers.txto b/Documentation/git-remote-helpers.txto
new file mode 100644
index 0000000..a966013
--- /dev/null
+++ b/Documentation/git-remote-helpers.txto
@@ -0,0 +1,25 @@
+git-remote-helpers(1)
+=====================
+
+NAME
+----
+git-remote-helpers - obsoleted page
+
+SYNOPSIS
+--------
+See linkgit:gitremote-helpers[1].
+
+DESCRIPTION
+-----------
+This document has been moved to linkgit:gitremote-helpers[1].
+
+Please let the owners of the referring site know so that they can update the
+link you clicked to get here.
+
+SEE ALSO
+--------
+linkgit:gitremote-helpers[1]
+
+GIT
+---
+No longer a part of the linkgit:git[1] suite
diff --git a/Documentation/git-remote-helpers.html b/Documentation/git-remote-helpers.html
deleted file mode 100644
index 0c5ec27..0000000
--- a/Documentation/git-remote-helpers.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
-<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
-<title>git-remote-helpers(1) - Document Moved</title>
-<style type="text/css">
-/* Cut-down styles from asciidoc.css. */
-
-/* Default font. */
-body {
- font-family: Georgia,serif;
-}
-
-/* Title font. */
-h1 {
- font-family: Arial,Helvetica,sans-serif;
-}
-
-body {
- margin: 1em 5% 1em 5%;
-}
-
-a {
- color: blue;
- text-decoration: underline;
-}
-a:visited {
- color: fuchsia;
-}
-
-h1, h2, h3, h4, h5, h6 {
- color: #527bbd;
- margin-top: 1.2em;
- margin-bottom: 0.5em;
- line-height: 1.3;
-}
-
-</style>
-</head>
-<body class="manpage">
-<div id="header">
-<h1>
-Document Moved
-</h1>
-</div>
-
-<p>This document is now called <a
-href="gitremote-helpers.html">gitremote-helpers</a>.</p>
-
-<p>Please let the owners of the referring site know so that they can update the
-link you clicked to get here.</p>
-
-</body>
-</html>
^ permalink raw reply related
* Re: [PATCH] gitremote-helpers.txt: rename from git-remote-helpers.txt
From: Junio C Hamano @ 2013-01-31 22:45 UTC (permalink / raw)
To: Tomas Carnecky; +Cc: John Keeping, git, Max Horn, Matthieu Moy
In-Reply-To: <1359671290-ner-7089@calvin>
Tomas Carnecky <tomas.carnecky@gmail.com> writes:
> On Thu, 31 Jan 2013 20:08:14 +0000, John Keeping <john@keeping.me.uk> wrote:
>> This is the patch to rename it to "gitremote-helpers.txt".
>>
>> Documentation/{git-remote-helpers.txt => gitremote-helpers.txt} | 6 +++---
>
> It feels somewhat weird to have 'git-remote' but 'gitremote-helpers'.
But the remote helpers are not helpers to "git remote" (which is
essentially a glorified wrapper around "git config -l remote.*").
^ permalink raw reply
* Re: [PATCH] Rename {git- => git}remote-helpers.txt
From: Junio C Hamano @ 2013-01-31 22:48 UTC (permalink / raw)
To: Jeff King; +Cc: John Keeping, git, Matthieu Moy, Max Horn
In-Reply-To: <20130131223305.GB21729@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Maybe it is just me, but the fact that accessing the manpage is now:
>
> man gitremote-helpers
>
> feels weird to me.
It feels equally weird to say "man gitremotehelpers" (or in general
"man git-thing" or "man gitconcept"), to me. I gave up and switched
to "git help remote-helpers" some time ago. "git help remotehelpers"
feels like a small regression.
> I dunno.
Me neither.
^ permalink raw reply
* Re: [PATCH] Rename {git- => git}remote-helpers.txt
From: John Keeping @ 2013-01-31 22:56 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Matthieu Moy, Max Horn
In-Reply-To: <7vtxpxdldj.fsf@alter.siamese.dyndns.org>
On Thu, Jan 31, 2013 at 02:43:20PM -0800, Junio C Hamano wrote:
> John Keeping <john@keeping.me.uk> writes:
>
> > Yes. Should I change it to "git-remote-helpers.html.in" and then copy
> > it into place? That seems like the simplest answer and means that
> > "*.html" will continue to refer only to generated files.
>
> I'd like to see if we can have a way to keep its look as the default
> css gets updated without maintainance burden.
>
> How about using AsciiDoc instead of "cp", perhaps like this on top
> of your patch?
I tried AsciiDoc first but didn't like the output. I think putting "See
gitremote-helpers" in the synopsis is the magic I was missing. This
looks good to me.
John
^ permalink raw reply
* Re: [PATCH] Rename {git- => git}remote-helpers.txt
From: Jonathan Nieder @ 2013-01-31 23:04 UTC (permalink / raw)
To: Jeff King; +Cc: John Keeping, git, Junio C Hamano, Matthieu Moy, Max Horn
In-Reply-To: <20130131223305.GB21729@sigill.intra.peff.net>
Jeff King wrote:
> Maybe it is just me, but the fact that accessing the manpage is now:
>
> man gitremote-helpers
>
> feels weird to me. I know it technically follows our syntactic rules,
> but having the lack of dash be significant between "git" and "remote",
> but then having a dash later makes it hard on the eyes.
Yes. I have thought for years that it should be git-remote-helpers,
that "git help" should be tweaked to look for that, and that the
existing gitrepository-layout and friends should be replaced with
redirects.
I didn't say anything (except a random comment once on #git) because I
can't promise to have time soon to work on it. Might try anyway.
Thanks,
Jonathan
^ permalink raw reply
* Re: [PATCH] Rename {git- => git}remote-helpers.txt
From: Junio C Hamano @ 2013-01-31 23:11 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Jeff King, John Keeping, git, Matthieu Moy, Max Horn
In-Reply-To: <20130131230455.GN27340@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
> Jeff King wrote:
>
>> Maybe it is just me, but the fact that accessing the manpage is now:
>>
>> man gitremote-helpers
>>
>> feels weird to me. I know it technically follows our syntactic rules,
>> but having the lack of dash be significant between "git" and "remote",
>> but then having a dash later makes it hard on the eyes.
>
> Yes. I have thought for years that it should be git-remote-helpers,
> that "git help" should be tweaked to look for that, and that the
> existing gitrepository-layout and friends should be replaced with
> redirects.
Because of the "git help" look up rules, we cannot have two pages
that only differ at the dash (or absense of it) immediately after
'git'; e.g. one about the concept of 'frotz' in the context of Git,
i.e. "man gitfrotz", and the other about the subcommand to perform
'frotz', i.e. "man git-frotz". The way to refer to these two pages
are both "git help frotz".
The simplest way forward may be to teach "git help" to try both
paths? But some people configure "git help -w" to refer to remote
site, so it won't be access(path, F_OK). Sigh...
^ permalink raw reply
* Re: [PATCH] Rename {git- => git}remote-helpers.txt
From: Jonathan Nieder @ 2013-01-31 23:13 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, John Keeping, git, Matthieu Moy, Max Horn
In-Reply-To: <7vhalxdk2q.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> Yes. I have thought for years that it should be git-remote-helpers,
>> that "git help" should be tweaked to look for that, and that the
>> existing gitrepository-layout and friends should be replaced with
>> redirects.
>
> Because of the "git help" look up rules, we cannot have two pages
> that only differ at the dash (or absense of it) immediately after
> 'git'; e.g. one about the concept of 'frotz' in the context of Git,
> i.e. "man gitfrotz", and the other about the subcommand to perform
> 'frotz', i.e. "man git-frotz". The way to refer to these two pages
> are both "git help frotz".
Exactly. Hence the disambiguating dash-versus-nondash convention buys
us nothing.
^ permalink raw reply
* Re: [PATCH] Rename {git- => git}remote-helpers.txt
From: Junio C Hamano @ 2013-01-31 23:49 UTC (permalink / raw)
To: John Keeping; +Cc: git, Matthieu Moy, Max Horn
In-Reply-To: <20130131225620.GQ1342@serenity.lan>
John Keeping <john@keeping.me.uk> writes:
> On Thu, Jan 31, 2013 at 02:43:20PM -0800, Junio C Hamano wrote:
>> John Keeping <john@keeping.me.uk> writes:
>>
>> > Yes. Should I change it to "git-remote-helpers.html.in" and then copy
>> > it into place? That seems like the simplest answer and means that
>> > "*.html" will continue to refer only to generated files.
>>
>> I'd like to see if we can have a way to keep its look as the default
>> css gets updated without maintainance burden.
>>
>> How about using AsciiDoc instead of "cp", perhaps like this on top
>> of your patch?
>
> I tried AsciiDoc first but didn't like the output. I think putting "See
> gitremote-helpers" in the synopsis is the magic I was missing. This
> looks good to me.
Actually I didn't mean "take this patch, it works". I've queued a
slightly different version and will push it out as part of 'pu'
later.
Thanks.
^ 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