git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] doc: update http.cookieFile with in-memory cookie processing

From
Piotr Szlazak <piotr.szlazak@gmail.com>
Date
Jul 11, 2024, 09:18 UTC
Message-ID
<3f69ec61-1ee3-4f4b-a773-86cbf73a627b@gmail.com>
In-Reply-To
<xmqq4j8ycgjj.fsf@gitster.g>
On 10.07.2024 01:05, Junio C Hamano wrote:
Show 13 quoted lines
> "Piotr Szlazak via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>>   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)`).
>> +	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)`).
> With line wrapping it is hard to see if there is any change above
> here, but I assume there is none?
Sorry for bad formatting, I'm still learning.
Show 5 quoted lines
>
>> +	Set it to empty value, to enable in-memory cookies processing.
> Is it understandable what "in-memory cookies processing" means to
> expected audience of this manual page?  I somehow doubt it (I
> certainly do not know what you wanted it to mean).

I pushed PATCH 2, this time without curl/libcurl terminology (i.e. without calling it in-memory cookie processing). Hope it helps. I also mentioned there that http.saveCookies has no effect if '' was used for http.cookieFile.

Regards!
-- 
Piotr Szlazak


>
> https://curl.se/libcurl/c/CURLOPT_COOKIEFILE.html has this to say:
>
>      By passing the empty string ("") to this option, you enable the
>      cookie engine without reading any initial cookies.
>
> But http.cookiefile is also used for CURLOPT_COOKIEJAR when
> http.savecookies is true.  Its documentation page does not say what
> would happen if you give an empty string to it.
>
> So, a casual one-line mention you added is a bit irresponsible.  At
> least you should warn against setting http.savecookies if the user
> chooses to use "" for this, or better yet, fix the codepath to use
> http.savecookies to prevent us from writing to a file with an empty
> filename.
>
> Also the libcURL documentation for CURLOPT_COOKIEFILE has another
> thing that is a bit worrysome:
>
>      If you tell libcurl the filename is "-" (just a single minus
>      sign), libcurl instead reads from stdin.
>
> So you can easily get your git get stuck by doing
>
>      git -c http.cookiefile=- fetch https://.....
>
> as libcURL will want to read from your stdin, while you are waiting
> for the fetch to finish and are not typing anything?
>
Previous: Junio C HamanoNext: Piotr Szlazak via GitGitGadget
Message 5 of 7 in “doc: update http.cookieFile with in-memory cookie processing”
  1. doc: update http.cookieFile with in-memory cookie processingPiotr Szlazak via GitGitGadget, Jun 23, 2024
  2. Piotr SzlazakJul 9, 2024
  3. Junio C HamanoJul 9, 2024
  4. Junio C HamanoJul 9, 2024
  5. Piotr SzlazakJul 11, 2024
  6. doc: update http.cookieFile with in-memory cookie processingPiotr Szlazak via GitGitGadget, Jul 11, 2024
  7. Junio C HamanoJul 11, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.