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

Carrying over attributes when moving files

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Mar 30, 2010, 21:30 UTC
Message-ID
<20100330213049.GB11192@progeny.tock>
In-Reply-To
<19377.33747.838003.360864@winooski.ccs.neu.edu>
Eli Barzilay wrote:
> There are a number of technicalities that make git attributes a poor
> substitute for svn properties -- mainly
[...]
> and
> the fact that they're not tracked with the files (as in svn, where
> moving a file somewhere will move its properties with it).
It would be great to improve this.
Consider the following directory hierarchy.
	old-files/
		.gitattributes
		some-file.html
		other-file.html
	new-files/
		unrelated-file.html
.gitattributes specifies that old HTML files use a CRLF line ending.
	*.html crlf
What would you expect the following commands to do?
	git mv old-files/some-file.html new-files/
	git commit
How about these?
	mv old-files/some-file.html new-files/
	git add new-files/some-file.html
	git commit -a

I don’t think there’s any fundamental reason this hasn’t been taken care of; it’s just that nobody has done it yet.

Thoughts welcome. Jonathan

Previous: Eli BarzilayNext: Eli Barzilay
Message 10 of 12 in “`git check-attr' problems & questions”
  1. Eli BarzilayMar 26, 2010
  2. Jonathan NiederMar 28, 2010
  3. Eli BarzilayMar 29, 2010
  4. Eli BarzilayMar 29, 2010
  5. git check-attr in bare repositoriesJonathan Nieder, Mar 29, 2010
  6. Eli BarzilayMar 30, 2010
  7. Jonathan NiederMar 30, 2010
  8. Jakub NarebskiMar 30, 2010
  9. Eli BarzilayMar 31, 2010
  10. Carrying over attributes when moving filesJonathan Nieder, Mar 30, 2010
  11. Eli BarzilayMar 31, 2010
  12. Junio C HamanoMar 31, 2010

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.