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

Re: git: "git stash" changes owners and permissions

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 6, 2011, 20:52 UTC
Message-ID
<20110406205212.GC1922@elie>
In-Reply-To
<20110406200640.GF12557@sym.noone.org>

(moving to the git list) Axel Beckert wrote[0]:

> I should probably look again for plugins or hooks taking care of file
> meta-data, but the last time I looked for such a thing, the stuff I
> found wasn't very promising. Any tips and hints are appreciated.

Everything I know about metadata tracking is at [1]. Which is to say, I don't know much. I believe the state of the art involves saving scripts to store metadata along with the repository, as in Dan Jacobson's git-cache-meta script and etckeeper's pre-commit.d directory[2]. [3]

As mentioned before, I don't advise using git to deploy changed files. It will change them in the wrong order and creates windows when they're not present. Perhaps a procedure like the following can work?

	cd /root; (umask 077 && mkdir tmp); cd tmp
	git clone /etc/interesting-subdir
	cd interesting-subdir
	... hack hack hack ...
	git commit
	... is it really ok?  check in whatever way I know ...
	# yes, it's okay.
	git push /etc/interesting-subdir/.git HEAD:refs/remotes/jrn/proposed
	cd /etc/interesting-subdir
	git diff jrn/proposed;	# one final check
	# deploy.
	rsync -a --exclude='.git' /root/tmp/interesting-subdir/ .
	git reset jrn/proposed
	git diff;	# should show no changes.
	# clean up.
	rm -r /root/tmp/interesting-subdir
	rmdir /root/tmp

Please keep us posted --- it would be nice to put whatever workflow you end up with in a howto for distribution with git.

Regards, Jonathan

[0] http://bugs.debian.org/621090 [1] https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools#Backups.2C_metadata.2C_and_large_files [2] http://git.kitenet.net/?p=etckeeper.git;a=tree;f=pre-commit.d;hb=master [3] It is as though we were in the days of shar as an archival format. In the long term I will be happier if something pleasant based on .gitattributes appears. ;-)

Next: Junio C Hamano
Message 1 of 3 in “Re: git: "git stash" changes owners and permissions”
  1. Jonathan NiederApr 6, 2011
  2. Junio C HamanoApr 6, 2011
  3. Jonathan NiederApr 6, 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.