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

Re: git-name-rev off-by-one bug

From
Petr Baudis <pasky@suse.cz>
Date
Nov 29, 2005, 10:31 UTC
Message-ID
<20051129103157.GW22159@pasky.or.cz>
In-Reply-To
<20051129080529.20705.qmail@science.horizon.com>

Dear diary, on Tue, Nov 29, 2005 at 09:05:29AM CET, I got a letter where linux@horizon.com said that...

> > *2* Cogito (things that start with cg-*) seems to try to be
> > cleverer.  Pasky might want to brag about the rules in Cogito
> > land.
> In fact, he might want to explain what the difference is between cogito
> and git.  Most particularly, are there any restrictions on mixing cg-*
> and git-* operations from within the same directory?
  Nope, except:

Cogito vs. other GIT tools ~~~~~~~~~~~~~~~~~~~~~~~~~~

You can *MOSTLY* use Cogito in parallel with other GIT frontends (e.g. StGIT), as well as the GIT plumbing and core GIT tools - the tools only need to keep HEAD in place and follow the standardized `refs/` hierarchy. The only notable exception is that you should stick with a single toolkit during a merge.

	(-- Cogito README)
  So exactly during a merge, things might not blend well, since Cogito
does things a bit differently. It knows of no MERGE_HEAD, MERGE_MSG and
such, and instead passes stuff over different channels or computes/asks
it at different times. Historically, cg-merge and git-merge evolution
has been almost entirely separate.
  From the user POV, the main difference between Cogito and GIT merging
is that:
  (i) Cogito tries to never leave the index "dirty" (i.e. containing
unmerged entries), and instead all conflicts should propagate to the
working tree, so that the user can resolve them without any further
special tools. (What is lacking here is that Cogito won't proofcheck
that you really resolved them all during a commit. That's a big TODO.
But core GIT won't you warn about committing the classical << >> ==
conflicts either.)
  (ii) Cogito will handle trees with some local modifications better -
basically any local modifications git-read-tree -m won't care about.
I didn't read the whole conversation, so to reiterate: git-read-tree
will complain when the index does not match the HEAD, but won't
complain about modified files in the working tree if the merge is not
going to touch them. Now, let's say you do this (output is visually
only roughly or not at all resembling what would real tools tell you):
	$ ls
	a b c
	$ echo 'somelocalhack' >>a
	$ git merge "blah" HEAD remotehead
	File-level merge of 'b' and 'c'...
	Oops, 'b' contained local conflicts.
	Automatic merge aborted, fix up by hand.
	$ fixup b
	$ git commit
	Committed files 'a', 'b', 'c'.

Oops. It grabbed your local hack and committed it along the merge. Cogito won't do this, it will hold 'a' back when doing the merge commit (if it works right; in the past, there were several bugs related to this, but hopefully they are all fixed by now):

	$ ls
	a b c
	$ echo 'somelocalhack' >>a
	$ cg-merge remotehead
	... Merging c
	... Merging b
	Conflicts during merge of 'b'.
		Fix up the conflicts, then kindly do cg-commit.
	$ fixup b
	$ cg-commit -m"blah"
	Committed files 'b', 'c'.

Also note that the cg-merge usage is simpler and you give the "blah" message only to cg-commit, when it's for sure you are going to use it.

  (iii) Cogito does not support the smart recursive merging strategy.
That means it won't follow renames, and in case of multiple merge bases,
it will not merge them recursively, but it will just ask you to choose
one manually, or suggest you the most conservative merge base (where you
should get no false clean merges, but you will probably have to deal
with a lot of conflicts).
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 64 in “git-name-rev off-by-one bug”
  1. linux@horizon.comNov 28, 2005
  2. Junio C HamanoNov 29, 2005
  3. linux@horizon.comNov 29, 2005
  4. Junio C HamanoNov 29, 2005
  5. Junio C HamanoNov 30, 2005
  6. Petr BaudisNov 29, 2005
  7. Junio C HamanoNov 29, 2005
  8. Petr BaudisDec 4, 2005
  9. as promised, docs: git for the confusedlinux@horizon.com, Dec 8, 2005
  10. Junio C HamanoDec 8, 2005
  11. H. Peter AnvinDec 8, 2005
  12. Alan ChandlerDec 9, 2005
  13. Petr BaudisDec 9, 2005
  14. Josef WeidendorferDec 9, 2005
  15. linux@horizon.comNov 29, 2005
  16. Junio C HamanoNov 29, 2005
  17. linux@horizon.comNov 30, 2005
  18. Junio C HamanoNov 30, 2005
  19. Junio C HamanoNov 30, 2005
  20. Linus TorvaldsNov 30, 2005
  21. Junio C HamanoNov 30, 2005
  22. Junio C HamanoNov 30, 2005
  23. Linus TorvaldsNov 30, 2005
  24. Linus TorvaldsNov 30, 2005
  25. Junio C HamanoNov 30, 2005
  26. Junio C HamanoNov 30, 2005
  27. Linus TorvaldsNov 30, 2005
  28. Linus TorvaldsNov 30, 2005
  29. Junio C HamanoDec 2, 2005
  30. merge-one-file: make sure we create the merged file.Junio C Hamano, Dec 2, 2005
  31. merge-one-file: make sure we do not mismerge symbolic links.Junio C Hamano, Dec 2, 2005
  32. git-merge documentation: conflicting merge leaves higher stages in indexJunio C Hamano, Dec 2, 2005
  33. linux@horizon.comNov 30, 2005
  34. Junio C HamanoNov 30, 2005
  35. More merge questionslinux@horizon.com, Nov 30, 2005
  36. Daniel BarkalowNov 30, 2005
  37. Junio C HamanoNov 30, 2005
  38. linux@horizon.comDec 2, 2005
  39. Junio C HamanoDec 2, 2005
  40. Sven VerdoolaegeDec 2, 2005
  41. Junio C HamanoDec 2, 2005
  42. Sven VerdoolaegeDec 5, 2005
  43. linux@horizon.comDec 2, 2005
  44. Junio C HamanoDec 2, 2005
  45. linux@horizon.comDec 2, 2005
  46. Junio C HamanoDec 2, 2005
  47. Linus TorvaldsDec 2, 2005
  48. linux@horizon.comDec 2, 2005
  49. linux@horizon.comDec 2, 2005
  50. Linus TorvaldsNov 30, 2005
  51. Junio C HamanoNov 30, 2005
  52. Junio C HamanoNov 30, 2005
  53. Junio C HamanoNov 30, 2005
  54. linux@horizon.comNov 30, 2005
  55. Daniel BarkalowNov 30, 2005
  56. Daniel BarkalowNov 30, 2005
  57. Junio C HamanoNov 30, 2005
  58. Daniel BarkalowNov 30, 2005
  59. Junio C HamanoNov 30, 2005
  60. Daniel BarkalowNov 30, 2005
  61. Junio C HamanoDec 1, 2005
  62. Junio C HamanoDec 1, 2005
  63. Petr BaudisDec 1, 2005
  64. Randal L. SchwartzDec 1, 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.