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

Re: confused about preserved permissions

From
JHJan Hudec <bulb@ucw.cz>
Date
Sep 3, 2007, 18:59 UTC
Message-ID
<20070903185916.GA3786@efreet.light.src>
In-Reply-To
<B38B8F2F-92B0-48F4-9093-54724FA862C2@lrde.epita.fr>
On Thu, Aug 23, 2007 at 09:48:23 +0200, Benoit SIGOURE wrote:
Show 9 quoted lines
> Hmm yes, that's right.
>
> Let's look at the problem from another point of view then: I want my 
> *working tree* to be group readable even though my umask is 066.  Would it 
> be possible to add a local config option in the .git repo to tell git that 
> it should create new file this way (exactly like core.sharedRepository but 
> core.sharedWorkingCopy or whatever).
>
> WDYT?

You need to change umask not just for git, but for your editor and compiler when you are working in the shared work tree as well, no? So what about teaching your *shell* to change it as appropriate?

In zsh if you define a function chpwd, it will be called whenever you change current working directory. If you define it as:

chpwd() {
    # The / at the end is to make foo/* match path foo
    case `pwd`/ in
	/path/to/your/worktree/*) umask 002;;
	*) umask 066;;
    esac
}

would make any command (ie. git, editor and compiler/make/...) ran from the shared worktree run with umask 002 (or whatever depending on permissions you want there) and anything ran from anywhere else use your normal umask 066.

I don't use bash, but I am almost sure you can get a suitable hook there as well. If nothing else I recall there is a way to run a function from prompt expansion, which would do the trick.

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Previous: David KastrupNext: Junio C Hamano
Message 22 of 39 in “confused about preserved permissions”
  1. martin f krafftAug 20, 2007
  2. Pierre HabouzitAug 20, 2007
  3. martin f krafftAug 20, 2007
  4. Mike HommeyAug 20, 2007
  5. David KastrupAug 20, 2007
  6. Mike HommeyAug 20, 2007
  7. David KastrupAug 20, 2007
  8. René ScharfeAug 21, 2007
  9. Documentation: update tar.umask defaultRené Scharfe, Aug 21, 2007
  10. Mike HommeyAug 21, 2007
  11. René ScharfeAug 22, 2007
  12. Alex RiesenAug 20, 2007
  13. Benoit SIGOUREAug 22, 2007
  14. Johannes SixtAug 22, 2007
  15. Junio C HamanoAug 22, 2007
  16. martin f krafftAug 23, 2007
  17. David KastrupAug 23, 2007
  18. martin f krafftAug 23, 2007
  19. Benoit SIGOUREAug 23, 2007
  20. Junio C HamanoAug 23, 2007
  21. David KastrupAug 23, 2007
  22. Jan HudecSep 3, 2007
  23. Junio C HamanoAug 23, 2007
  24. Mike HommeyAug 20, 2007
  25. Jan HudecAug 20, 2007
  26. Mike HommeyAug 20, 2007
  27. Alex RiesenAug 20, 2007
  28. Mike HommeyAug 20, 2007
  29. Jan HudecAug 20, 2007
  30. David KastrupAug 20, 2007
  31. Mike HommeyAug 20, 2007
  32. Jan HudecAug 20, 2007
  33. David KastrupAug 20, 2007
  34. Mike HommeyAug 20, 2007
  35. David KastrupAug 20, 2007
  36. Shawn O. PearceAug 21, 2007
  37. Junio C HamanoAug 21, 2007
  38. Mike HommeyAug 21, 2007
  39. David KastrupAug 21, 2007

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.