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

Re: git archive: tar.umask ignored

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Apr 12, 2011, 18:19 UTC
Message-ID
<4DA497B7.706@lsrfire.ath.cx>
In-Reply-To
<BANLkTimTs+Qh9fNs6pLcZidYy-YjXNR2iw@mail.gmail.com>
Am 12.04.2011 11:39, schrieb Jacek Masiulaniec:
Show 18 quoted lines
> Hello git@,
>
> I believe git has an issue with command line override of configuration options.
> Notice how in both cases below the file mode is 775 despite tar.umask
> difference:
>
> [jacekm@localhost git]$ ./git --version
> git version 1.7.4.4
> [jacekm@localhost git]$ ./git archive --remote=/repo/website.git HEAD
> | tar -tvf - | head -1
> drwxrwxr-x root/root         0 2011-04-11 13:47:09 bin/
> [jacekm@localhost git]$ ./git -c tar.umask=0022 archive
> --remote=/repo/website.git HEAD | tar -tvf - | head -1
> drwxrwxr-x root/root         0 2011-04-11 13:47:09 bin/
> [jacekm@localhost git]$
>
> In contrast, tweaking tar.umask in ~/.gitconfig does have the desired
> impact on the file mode.

The local setting of tar.umask does not affect the archive created at the remote end. If your "remote" repository is in fact located on the same machine and accessed with the same user then of course settings in ~/.gitconfig will take effect.

If --remote is specified then the local archive process just passes all command line options (except --remote itself, --output and --exec) to the other side which then does all the actual work. The config option tar.umask is not even read in that case.

We'd need to read all relevant config settings (from the command line, and perhaps the user's config file and the system-wide one, but not the ones from any local repository) and then pass them over somehow. We could piggy-back on the existing command line option passing, but for that we'd need to add new command line options. OK, just a single one, because archive only recognizes tar.umask currently.

Would a new --umask command line option alone (that overrides any config setting) be sufficient for your use case?

Thanks, René

Previous: Jacek MasiulaniecNext: René Scharfe
Message 2 of 6 in “git archive: tar.umask ignored”
  1. Jacek MasiulaniecApr 12, 2011
  2. René ScharfeApr 12, 2011
  3. René ScharfeApr 12, 2011
  4. Jacek MasiulaniecApr 12, 2011
  5. René ScharfeApr 14, 2011
  6. Junio C HamanoApr 14, 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.