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

Re: Questions on 'cvs migration guide''

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 19, 2005, 15:18 UTC
Message-ID
<Pine.LNX.4.58.0508190812490.3412@g5.osdl.org>
In-Reply-To
<46a038f9050818225865deb7ee@mail.gmail.com>
On Fri, 19 Aug 2005, Martin Langhoff wrote:
> 
> I'm keen on keeping my 'merge & publish' step in a single repo that
> has all the 'team' branches. The person running this repo will
> probably actually code in separate repos, and merge in there too.

I would suggest against a person owning a "merge and publish". Instead, just have a public repo that everybody involved to can push to - _they_ will need to merge before they push (since a push won't accept a unrelated parent), but that way anybody can export their changes at any time, exactly like with a central CVS repository.

> Right now I'm switching 'heads' (I'm getting used to cogito's use of
> 'branch' for 'remote head') using this quick'n'dirty bit of shell:
No, just do
	git checkout <headname>
> but I want to prevent the action if the checkout is 'dirty'. Is there
> any way to check whether cg-diff thinks anything has changed?

If you use "git checkout" to switch branches, it will do that testing for you. You can still _force_ a head switch with "git checkout -f".

Oh, and if a file was dirty that is the same in both heads, the "dirtyness" follows you into the new head. If that isn't what you want, then you need to add some logic like

	if [ "$(git-diff-files)" != "" ]; then
		echo "Current branch not clean" >&2
		exit 1
	fi
	git checkout "$@"
or something.
		Linus
Previous: Martin Langhoff
Message 4 of 4 in “Questions on 'cvs migration guide''”
  1. Martin LanghoffAug 19, 2005
  2. Linus TorvaldsAug 19, 2005
  3. Martin LanghoffAug 19, 2005
  4. Linus TorvaldsAug 19, 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.