我试图找出为什么来自提交的更改消失了。我在一个分支上,历史上约有70个提交:
commit 7000210f4f7abd3f77524cdf1db548d775082e32
Author: John Doe <John.Doe@xyz.com>
Date: Fri Mar 31 14:53:44 2017 -0400
CQP3-790 - adding logging for error.
commit 73c4e3c1e65250a6acfb532f7bcadff2f3655a79
Author: Jane Doe <Jane.Doe@xyz.com>
Date: Fri Mar 31 14:23:43 2017 +0530
CQP3-415 updated build.xml
查看第二次提交:
$ git show 73c4e3c1e65250a6acfb532f7bcadff2f3655a79
commit 73c4e3c1e65250a6acfb532f7bcadff2f3655a79
Author: Jane Doe <Jane.Doe@xyz.com>
Date: Fri Mar 31 14:23:43 2017 +0530
CQP3-415 updated build.xml
diff --git a/build.xml b/build.xml
index c898f15..9ddc1b8 100644
--- a/build.xml
+++ b/build.xml
@@ -102,8 +102,8 @@
<include name="*.properties"/>
</fileset>
</copy>
- <copy todir="${build.dir}/conf/neptune">
- <fileset dir="${src.dir}/conf/neptune">
+ <copy todir="${build.dir}/jar/conf/neptune">
+ <fileset
dir="${basedir}/lib/cqp_batch/src/conf/neptune">
<include name="*.xml" />
<include name="*.properties" />
</fileset>
当我对两个提交进行区分时,我会看到删除的代码:
$ git diff 73c4e3c1e65250a6acfb532f7bcadff2f3655a79 \
7000210f4f7abd3f77524cdf1db548d775082e32 build.xml
diff --git a/build.xml b/build.xml
index 9ddc1b8..f9c4a87 100644
--- a/build.xml
+++ b/build.xml
@@ -102,12 +102,6 @@
<include name="*.properties"/>
</fileset>
</copy>
- <copy todir="${build.dir}/jar/conf/neptune">
- <fileset \
dir="${basedir}/lib/cqp_batch/src/conf/neptune">
- <include name="*.xml" />
- <include name="*.properties" />
- </fileset>
- </copy>
<!-- Added for EmailEngine -->
<copy todir="${build.dir}/jar/conf/emailengine">
<fileset \
dir="${basedir}/lib/cqp_batch/src/conf/emailengine">
@@ -230,4 +224,4 @@
<echo message="Package url is \
${pkg.repo}/batch/tags/${DSTAMP}_${TSTAMP}_src_${source.rev}" />-->
</target>
</project>
-
+
\ No newline at end of file
但是,关键是后面的提交与build.xml文件无关:
$ git show 7000210f4f7abd3f77524cdf1db548d775082e32
commit 7000210f4f7abd3f77524cdf1db548d775082e32
Author: John Doe <John.Doe@xyz.com>
Date: Fri Mar 31 14:53:44 2017 -0400
CQP3-790 - adding logging for error.
diff --git a//SomeImpl.java b/SomeImpl.java
index 04a4a94..aa399d5 100644
---
<snip>
作为一个谜,我做的时候:
$ git log --full-history -5 build.xml
它指的是另一个与build.xml无关的提交。
似乎存储库已经发生了变化,但是失去了对提交负责的跟踪。
想法?