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

Re: [ANNOUNCE] Git 1.7.8.rc0

From
Jeff King <peff@peff.net>
Date
Nov 2, 2011, 18:10 UTC
Message-ID
<20111102181041.GA5366@sigill.intra.peff.net>
In-Reply-To
<20111102180327.GA30668@sigill.intra.peff.net>
On Wed, Nov 02, 2011 at 02:03:27PM -0400, Jeff King wrote:
Show 13 quoted lines
> Without using a configured remote, try this (with .netrc configured):
> 
>   git push https://github.com/user/repo.git :refs/heads/nothing
> 
> which should work, and then this:
> 
>   git push https://user@github.com/user/repo.git :refs/heads/nothing
> 
> which will do the "must hit enter to accept password" thing.
> 
> That fails even with v1.7.7. I didn't bisect, but it has been there
> quite a while (v1.6.6 has it, but v1.6.5 has a weird error, so I didn't
> bisect further).
OK, I see the issue.

The logic is "if we have a username, but not a password, then ask for the password before trying any http" (this is what avoids the extra round trip).

But if you are using netrc, we don't parse it ourselves. We just tell curl "when you are making the request, check netrc, too".

So the ideal logic is:
  1. look in netrc
  2. If we have a username and no password, ask for password
  3. Otherwise, try it and see if we get a 401.

But we can't do that, because (1) and (3) happen atomically inside of curl.

The simplest thing is to just drop the behavior in (2), and let it drop to a 401. The extra round trip probably isn't that big a deal.

The other option is to start parsing netrc ourselves, or do the extra round trip if we detect ~/.netrc or something. But that last one is getting pretty hackish.

-Peff
Previous: Jeff KingNext: Junio C Hamano
Message 11 of 26 in “[ANNOUNCE] Git 1.7.8.rc0”
  1. Junio C HamanoOct 31, 2011
  2. Stefan NäweOct 31, 2011
  3. Junio C HamanoOct 31, 2011
  4. Stefan NäweNov 1, 2011
  5. Junio C HamanoNov 1, 2011
  6. Jeff KingNov 1, 2011
  7. Stefan NaeweNov 1, 2011
  8. Stefan NaeweNov 1, 2011
  9. Michael J GruberNov 2, 2011
  10. Jeff KingNov 2, 2011
  11. Jeff KingNov 2, 2011
  12. Junio C HamanoNov 2, 2011
  13. Jeff KingNov 2, 2011
  14. Junio C HamanoNov 3, 2011
  15. Stefan NaeweNov 1, 2011
  16. http-push: don't always prompt for password (Was Re: [ANNOUNCE] Git 1.7.8.rc0)Stefan Näwe, Nov 2, 2011
  17. Michael J GruberNov 2, 2011
  18. Junio C HamanoNov 2, 2011
  19. Jeff KingNov 2, 2011
  20. Junio C HamanoNov 2, 2011
  21. http-push: don't always prompt for passwordStefan Naewe, Nov 4, 2011
  22. Junio C HamanoNov 4, 2011
  23. Jeff KingNov 4, 2011
  24. Junio C HamanoNov 4, 2011
  25. Stefan NaeweNov 4, 2011
  26. Junio C HamanoNov 5, 2011

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.