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

Re: [PATCH] git: add --no-optional-locks option

From
Jeff King <peff@peff.net>
Date
Sep 27, 2017, 06:40 UTC
Message-ID
<20170927064026.5xa3ydaggmknvulw@sigill.intra.peff.net>
In-Reply-To
<79ed4c34-1727-7c1e-868a-1206902638ad@gmail.com>
On Sun, Sep 24, 2017 at 01:08:41PM +0530, Kaartic Sivaraam wrote:
Show 7 quoted lines
> On Thursday 21 September 2017 10:02 AM, Jeff King wrote:
> > Some tools like IDEs or fancy editors may periodically run
> > commands like "git status" in the background to keep track
> > of the state of the repository.
> 
> I might be missing something, shouldn't the IDEs be encouraged to use
> libgit2 instead? I thought it was meant for these use cases.

GitHub Desktop, at least, has actually moved _away_ from libgit2. I think there were a number of reasons. Some match what Dscho said regarding Visual Studio. But I think a main one is just that libgit2 doesn't quite match regular git for feature parity or pace of development. So you're stuck shelling out to regular Git half the time anyway, and now you get to handle dependencies on _two_ systems. :)

> Note: I assume getting the status through libgit2 doesn't create an
> index.lock file.
I don't know if that's the case or not.
> > This patch implements the option 3.
> 
> So, if I get that correctly "git status --no-optional-locks" is a way to get
> the "current" status without updating the on disk index file?

It's actually "git --no-optional-locks status", since it's a git-wide option (it's just that "status" is the only one who respects it for now).

Show 9 quoted lines
> > +`GIT_OPTIONAL_LOCKS`::
> > +	If set to `0`, Git will avoid performing any operations which
> > +	require taking a lock and which are not required to complete the
> > +	requested operation.
> 
> The above sentence seems to be a little confusing. How about,
> 
>    If set to `0`, Git will complete the requested operation without
>    performing the optional sub-operations that require taking a lock.
Yeah, my original is pretty clunky. I ended up with:
  If set to `0`, Git will complete any requested operation without
  performing any optional sub-operations that require taking a lock.
which swaps out "the" for "any".
Thanks.
-Peff
Previous: Johannes SchindelinNext: Kaartic Sivaraam
Message 24 of 26 in “git: add --no-optional-locks option”
  1. git: add --no-optional-locks optionJeff King, Sep 21, 2017
  2. Junio C HamanoSep 21, 2017
  3. Jeff KingSep 21, 2017
  4. Junio C HamanoSep 21, 2017
  5. Johannes SixtSep 21, 2017
  6. Jeff KingSep 22, 2017
  7. Jeff HostetlerSep 22, 2017
  8. Jeff KingSep 22, 2017
  9. Stefan BellerSep 22, 2017
  10. Jeff KingSep 22, 2017
  11. Stefan BellerSep 22, 2017
  12. Jeff KingSep 23, 2017
  13. Stefan BellerSep 25, 2017
  14. Jeff KingSep 27, 2017
  15. Daniel SantosSep 22, 2017
  16. Jeff KingSep 22, 2017
  17. Kaartic SivaraamSep 24, 2017
  18. Johannes SchindelinSep 25, 2017
  19. Jeff HostetlerSep 26, 2017
  20. Johannes SchindelinSep 25, 2017
  21. Jeff KingSep 25, 2017
  22. git: add --no-optional-locks optionJeff King, Sep 27, 2017
  23. Johannes SchindelinSep 28, 2017
  24. Jeff KingSep 27, 2017
  25. Kaartic SivaraamSep 27, 2017
  26. Jeff KingSep 27, 2017

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.