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

Re: [PATCH 0/2] apply.c: a fix and an enhancement

From
Linus Torvalds <torvalds@osdl.org>
Date
Jul 22, 2005, 23:50 UTC
Message-ID
<Pine.LNX.4.58.0507221640050.6074@g5.osdl.org>
In-Reply-To
<20050722233344.GP11916@pasky.ji.cz>
On Sat, 23 Jul 2005, Petr Baudis wrote:
> 
> Yes, but this stuff is not for personal preferences. It is for
> project-wide preferences and policies, which can be still normally
> overridden or altered locally in each repository.
What you are describing is a nightmare.
Let's assume that a user alters the settings locally.

EVERY SINGLE TIME he does a "cg-commit", those local alterations would get committed, since that config file is part of the same project, and cogito by default commits all changes.

That's just insane. It means that in practive it's simply not reasonable to have your own local copies of that file. So what would you do? You'd add more and more hacks to cover this up, and have a "commit-ignore" file that ignores the .gitinfo files etc etc. UGLY. All because of a design mistake.

In contrast, let's say that the .gitinfo/xyzzy files were in another unrelated branch altogether: that means that normally those files wouldn't even be seen by git as being under revision control (the "index" file doesn't mention them, nor the tree pointed to by HEAD), but you could, if you wanted to, do a simple

	#
	# edit the control files  and check the
	# changes  in to the control stream
	#
	git switch control-files
	.. edit .gitinfo/xyzzy
	git commit --all
	#
	# get back to the real project
	#
	git switch master

and it just works. In the above "git switch" would be exactly the same as a normal "git checkout", except it's told to not update the current directory contexts on switch and instead just save the index file away and restore it. (In contrast, using a full "git checkout" would remove the real project when switching to the control files, and then again remove the control files when switching back to the main project).

		Linus
Previous: Petr BaudisNext: Petr Baudis
Message 15 of 16 in “apply.c: a fix and an enhancement”
  1. 0/2 apply.c: a fix and an enhancementJunio C Hamano, Jul 22, 2005
  2. Ryan AndersonJul 22, 2005
  3. Junio C HamanoJul 22, 2005
  4. Ryan AndersonJul 22, 2005
  5. A Large Angry SCMJul 22, 2005
  6. Linus TorvaldsJul 22, 2005
  7. Junio C HamanoJul 22, 2005
  8. Linus TorvaldsJul 22, 2005
  9. Santi BéjarJul 22, 2005
  10. Junio C HamanoJul 22, 2005
  11. Linus TorvaldsJul 22, 2005
  12. Petr BaudisJul 22, 2005
  13. Junio C HamanoJul 23, 2005
  14. Petr BaudisJul 22, 2005
  15. Linus TorvaldsJul 22, 2005
  16. Petr BaudisJul 22, 2005

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.