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

how to fix the problem correctly?

From
ESEugene Sajine <euguess@gmail.com>
Date
Apr 28, 2010, 16:54 UTC
Message-ID
<w2t76c5b8581004280954r436c1be1g8d6e415bf3596f4d@mail.gmail.com>
I have a following situation (in dev branch):

3 files: 1.txt, 2.txt, 3.txt

A -> B -> C -> D -> E
        |                     |
   Master               dev

Between B and C the version of file 1.txt was screwed up (let’s say it was copied into git repo from other location where it was in state A (CVS) and then committed by mistake in C, effectively reverting the change of this file in commit B) Commit C also had changes to files 2 and 3. After this commits D and E did not have changes for file 1.txt, only 2 and 3 were touched.

When we tried to revert commit C – this lead to the code completely messed up, with conflicts – so this seems to be not an option. Rebase also doesn’t seem to help here

Only two variants I saw:
1. Do “git co A 1.txt” and commit the change as F
2. Do “git reset –soft master” and recommit all changes once again
Is there a better way?

PS interesting enough – CVS keywords helped us to notice the problem as master state was imported from CVS. In commit A file 1.txt had version ID 1.5 in commit B it was 1.6 , commit C was changing the line back to 1.5 Is there a way for git to help me to recognize this kind of issue if there are no keywords?

DISCLAIMER: I don’t like keywords, and I don’t want them to be
implemented in git.

Thanks, Eugene

Next: Avery Pennarun
Message 1 of 3 in “how to fix the problem correctly?”
  1. Eugene SajineApr 28, 2010
  2. Avery PennarunApr 28, 2010
  3. Eugene SajineApr 28, 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.