From: Junio C Hamano <gitster@pobox•com>
To: "Piotr Szlazak via GitGitGadget" <gitgitgadget@gmail•com>
Cc: git@vger•kernel.org, Jeff King <peff@peff•net>,
"brian m. carlson" <sandals@crustytoothpaste•net>,
Piotr Szlazak <piotr.szlazak@gmail•com>
Subject: Re: [PATCH v2] doc: update http.cookieFile with in-memory cookie processing
Date: Thu, 11 Jul 2024 09:05:42 -0700 [thread overview]
Message-ID: <xmqqo773syll.fsf@gitster.g> (raw)
In-Reply-To: <pull.1733.v2.git.git.1720687008915.gitgitgadget@gmail.com> (Piotr Szlazak via GitGitGadget's message of "Thu, 11 Jul 2024 08:36:48 +0000")
"Piotr Szlazak via GitGitGadget" <gitgitgadget@gmail•com> writes:
> From: Piotr Szlazak <piotr.szlazak@gmail•com>
Thanks.
> Information added how to enable in-memory cookies
> processing. Cookies from server will be accepted and send
> back in successive requests within same connection.
>
> At the moment documentation only mentions how to read
> cookies from the given file and how to save them to the file
> using http.saveCookies.
>
> curl / libcurl will process cookies in memory if file name
> is blank. Check curl manpage:
> https://curl.se/docs/manpage.html#-b
> This is described here in more details:
> https://everything.curl.dev/http/cookies/engine.html
> And also explained here:
> https://www.youtube.com/watch?v=V5vZWHP-RqU&t=11459s
>
> Git documentation was updated to include suggestion how to
> enable this by setting empty value for http.cookieFile.
>
> Changes since V1:
> - better explanation what in-memory processing means
> - added explanation that http.saveCookies does not work
> if http.cookieFile was set to empty value
>
> Signed-off-by: Piotr Szlazak <piotr.szlazak@gmail•com>
> ---
Here is how I amended the log message, FYI.
doc: update http.cookieFile with in-memory cookie processing
Documentation only mentions how to read cookies from the given file
and how to save them to the file using http.saveCookies.
But underlying libcURL allows the HTTP cookies used only in memory;
cookies from the server will be accepted and sent back in successive
requests within same connection, by using an empty string as the
filename. Document this.
Signed-off-by: Piotr Szlazak <piotr.szlazak@gmail•com>
Signed-off-by: Junio C Hamano <gitster@pobox•com>
A few points to note:
- It is our convention to start a proposed log message by
describing the current status in present tense ("currently", "at
the moment", etc., are not needed).
- The observation of the current status is followed by the
description of a problem the patch tries to solve.
- And then finally we give an order to the codebase to "become like
so".
- Changes between iterations do not belong to the log message, as
the log messages are written for those who run "git log"; to
them, our previous iterations do not exist. We describe changes
below the "---" lines.
> diff --git a/Documentation/config/http.txt b/Documentation/config/http.txt
> index 2d4e0c9b869..e71ca11c10b 100644
> --- a/Documentation/config/http.txt
> +++ b/Documentation/config/http.txt
> @@ -78,16 +78,18 @@ http.extraHeader::
>
> http.cookieFile::
> The pathname of a file containing previously stored cookie lines,
> - which should be used
> - in the Git http session, if they match the server. The file format
> - of the file to read cookies from should be plain HTTP headers or
> - the Netscape/Mozilla cookie file format (see `curl(1)`).
> - NOTE that the file specified with http.cookieFile is used only as
> - input unless http.saveCookies is set.
> + which should be used in the Git http session, if they match the server.
> + The file format of the file to read cookies from should be plain HTTP
> + headers or the Netscape/Mozilla cookie file format (see `curl(1)`).
> + Set it to empty value (''), to accept only new cookies from the server and
> + send them back in successive requests within same connection. NOTE that the
> + file specified with http.cookieFile is used only as input unless
> + http.saveCookies is set.
>
> http.saveCookies::
> If set, store cookies received during requests to the file specified by
> - http.cookieFile. Has no effect if http.cookieFile is unset.
> + http.cookieFile. Has no effect if http.cookieFile is not set or set to empty
> + value ('').
I reformatted the patch and added minor word-smithing. A few points:
- Avoid unnecessary line rewrapping. This file gets formatted into
HTML or manpage and formatting tools will take care of filling
paragraphs.
- Use "an empty string", which is used by other parts of this file
and other documentation files under Documentaiton/config/
directory, instead of "empty value". We should fix other
instances of "empty value" in the file for consistency but it
should be left outside the scope of this patch as #leftoverbits
material.
Thanks again.
diff --git a/Documentation/config/http.txt b/Documentation/config/http.txt
index 2d4e0c9b86..bd04ca1c2e 100644
--- a/Documentation/config/http.txt
+++ b/Documentation/config/http.txt
@@ -82,12 +82,16 @@ http.cookieFile::
in the Git http session, if they match the server. The file format
of the file to read cookies from should be plain HTTP headers or
the Netscape/Mozilla cookie file format (see `curl(1)`).
+ Set it to an empty string, to accept only new cookies from
+ the server and send them back in successive requests within same
+ connection.
NOTE that the file specified with http.cookieFile is used only as
input unless http.saveCookies is set.
http.saveCookies::
If set, store cookies received during requests to the file specified by
- http.cookieFile. Has no effect if http.cookieFile is unset.
+ http.cookieFile. Has no effect if http.cookieFile is unset, or set to
+ an empty string.
http.version::
Use the specified HTTP protocol version when communicating with a server.
prev parent reply other threads:[~2024-07-11 16:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-23 21:24 [PATCH] doc: update http.cookieFile with in-memory cookie processing Piotr Szlazak via GitGitGadget
2024-07-09 21:37 ` Piotr Szlazak
2024-07-09 22:30 ` Junio C Hamano
2024-07-09 23:05 ` Junio C Hamano
2024-07-11 9:18 ` Piotr Szlazak
2024-07-11 8:36 ` [PATCH v2] " Piotr Szlazak via GitGitGadget
2024-07-11 16:05 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqo773syll.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitgitgadget@gmail$(echo .)com \
--cc=peff@peff$(echo .)net \
--cc=piotr.szlazak@gmail$(echo .)com \
--cc=sandals@crustytoothpaste$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox