-
I am using GitPython 3.1.37 to use commit history for software analysis. I am not sure this is bug. If not, I want to know when it happens. The sample code to reproduce my situation is like follows: from git import Repo
# used repository: https://github.com/gocd/gocd
repo = Repo('/path/to/repository')
prev_commit = repo.commit('86064ef5ee28e0d0d12911f46fd603d15246fdd5')
next_commit = repo.commit('42e58c22aefd036b6fdd2095ed0d391f5238c6c4')
diff_index = prev_commit.diff(next_commit, create_patch=True)
# one example file
target_diff = list(filter(
lambda d: d.a_path == 'agent-bootstrapper/src/com/thoughtworks/go/agent/bootstrapper/osx/MacAboutBox.java',
diff_index))[0]
print(target_diff.change_type) # `None` printed The result of actual # git diff 86064ef5ee28e0d0d12911f46fd603d15246fdd5 42e58c22aefd036b6fdd2095ed0d391f5238c6c4 --diff-filter 'M' -- agent-bootstrapper/src/com/thoughtworks/go/agent/bootstrapper/osx/MacAboutBox.java
diff --git a/agent-bootstrapper/src/com/thoughtworks/go/agent/bootstrapper/osx/MacAboutBox.java b/agent-bootstrapper/src/com/thoughtworks/go/agent/bootstrapper/osx/MacAboutBox.java
index 0103494d4a..90d876badb 100644
--- a/agent-bootstrapper/src/com/thoughtworks/go/agent/bootstrapper/osx/MacAboutBox.java
+++ b/agent-bootstrapper/src/com/thoughtworks/go/agent/bootstrapper/osx/MacAboutBox.java
@@ -55,7 +55,7 @@ public class MacAboutBox extends JFrame implements ActionListener {
aboutLabels.add(bodyLabel("Bootstrapper Version " + getBootstrapperVersion()));
aboutLabels.add(emptyLabel());
aboutLabels.add(bodyLabel("Java Version " + System.getProperty("java.version")));
- aboutLabels.add(bodyLabel("Copyright (C) 2013 ThoughtWorks Inc."));
+ aboutLabels.add(bodyLabel("Copyright (C) 2015 ThoughtWorks Inc."));
aboutLabels.add(emptyLabel());
Panel textPanel2 = new Panel(new GridLayout(aboutLabels.size(), 1)); Thank you for any help you can offer. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I looks like The actual problem seems to be though that a modified file isn't classified as such - instead, no classification is provided. Since I don't know why that is, a contributor could probably create a test with reproduction and fix it that way, or at least, understand what's going on. Instead of trying to fix this, I recommend using |
Beta Was this translation helpful? Give feedback.
I looks like
change_type
is known to possibly beNone
as per the bolted on type-system. Ideally the editor would know and warn about it, but apparently this didn't happen here.The actual problem seems to be though that a modified file isn't classified as such - instead, no classification is provided.
Since I don't know why that is, a contributor could probably create a test with reproduction and fix it that way, or at least, understand what's going on.
Instead of trying to fix this, I recommend using
gitoxide
- it will probably be multiple times faster and doesn't have these typing problems either.