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

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

From
Johannes Sixt <j6t@kdbg.org>
Date
Sep 21, 2017, 18:25 UTC
Message-ID
<7a2d895c-df8c-1305-234f-7f8e2b271ec2@kdbg.org>
In-Reply-To
<20170921043214.pyhdsrpy4omy54rm@sigill.intra.peff.net>
Am 21.09.2017 um 06:32 schrieb Jeff King:
Show 27 quoted lines
> diff --git a/Documentation/git.txt b/Documentation/git.txt
> index 6e3a6767e5..8dd3ae05ae 100644
> --- a/Documentation/git.txt
> +++ b/Documentation/git.txt
> @@ -159,6 +159,10 @@ foo.bar= ...`) sets `foo.bar` to the empty string which ` git config
>   	Add "icase" magic to all pathspec. This is equivalent to setting
>   	the `GIT_ICASE_PATHSPECS` environment variable to `1`.
>   
> +--no-optional-locks::
> +	Do not perform optional operations that require locks. This is
> +	equivalent to setting the `GIT_OPTIONAL_LOCKS` to `0`.
> +
>   GIT COMMANDS
>   ------------
>   
> @@ -697,6 +701,15 @@ of clones and fetches.
>   	which feed potentially-untrusted URLS to git commands.  See
>   	linkgit:git-config[1] for more details.
>   
> +`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. For example, this will prevent `git status`
> +	from refreshing the index as a side effect. This is useful for
> +	processes running in the background which do not want to cause
> +	lock contention with other operations on the repository.
> +	Defaults to `1`.

I don't think we should pass this environment variable to remote repositories. It should be listed in local_repo_env[] in environment.c.

-- Hannes
Previous: Junio C HamanoNext: Jeff King
Message 5 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.