У меня есть файл со структурой
<parent>
<child name='abc'>
<grandchild/>
<grandchild/>
<grandchild/>
</child>
<child name='xyz'>
<grandchild/>
<grandchild/>
<grandchild/>
</child>
....
<parent>
Некоторое время назад мы решили изменить порядок файлов, но блоки остались нетронутыми.
Я пытался использовать
git log -L1994,1996:myfile.xml
это дало следующий вывод, который близок к тому, что я ищу для проблемы, потому что я был в текущем коммите в строках 3784-3788
diff --git a/myFile.xml b/myFile.xml
--- a/myFile.xml
+++ b/myFile.xml
@@ -1336,4 +1903,4 @@
- <child name="zzxxyy" >
- <grandChild >...</grandChild>
- <grandChild >...</grandChild>
+ <child name="aabbcc" >
+ <grandChild attr='...'/>
+ <grandChild >...</grandChild>
+ <grandChild >...</grandChild>
commit ###
Author: fred
ABC-456 blah blah blah
diff --git a/myFile.xml b/myFile.xml
--- a/myFile.xml
+++ b/myFile.xml
@@ -283,3 +283,4 @@
<child name="zzxxyy" >
- <grandChild attr="..."/>
+ <grandChild >...</grandChild>
+ <grandChild >...</grandChild>
commit ###
Author: fred
ABC-123 blah blah blah
diff --git a/myFile.xml b/myFile.xml
--- a/myFile.xml
+++ b/myFile.xml
@@ -249,0 +254,3 @@
+ <child name="zzxxyy" >
+ <grandChild attr="..."/>
Я надеялся, что это отследит "aabbcc "назад через журнал.
например,
@@ -338,4 +1903,4 @@
- <child name="aabbcc" >
- <grandChild attr='...'/>
- <grandChild >...</grandChild>
- <grandChild >...</grandChild>
+ <child name="aabbcc" >
+ <grandChild attr='...'/>
+ <grandChild >...</grandChild>
+ <grandChild >...</grandChild>
Но я ожидаю, что я спрашиваю слишком много.
Использование git версии 2.12.2