Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GitWrapper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Georg Seibt
GitWrapper
Commits
fc21f671
Commit
fc21f671
authored
8 years ago
by
Florian Heck
Browse files
Options
Downloads
Patches
Plain Diff
refactoring of blame line parsing
parent
72309f37
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/de/uni_passau/fim/seibt/gitwrapper/repo/DummyCommit.java
+1
-0
1 addition, 0 deletions
src/de/uni_passau/fim/seibt/gitwrapper/repo/DummyCommit.java
src/de/uni_passau/fim/seibt/gitwrapper/repo/Repository.java
+10
-16
10 additions, 16 deletions
src/de/uni_passau/fim/seibt/gitwrapper/repo/Repository.java
with
11 additions
and
16 deletions
src/de/uni_passau/fim/seibt/gitwrapper/repo/DummyCommit.java
+
1
−
0
View file @
fc21f671
...
...
@@ -60,5 +60,6 @@ public class DummyCommit extends Commit {
private
void
setterWarning
()
{
LOG
.
warning
(()
->
"Ignoring a setter call on the DummyCommit for "
+
repo
);
// TODO gets called often while parsing blame lines, maybe change level
}
}
This diff is collapsed.
Click to expand it.
src/de/uni_passau/fim/seibt/gitwrapper/repo/Repository.java
+
10
−
16
View file @
fc21f671
...
...
@@ -34,6 +34,7 @@ public class Repository {
private
static
final
String
COMMITTER_TIME
=
"committer-time"
;
private
static
final
String
COMMITTER_TZ
=
"committer-tz"
;
private
static
final
String
FILENAME
=
"filename"
;
private
static
final
String
MESSAGE
=
"summary"
;
// The type returned for commits by 'git cat-file -t".
private
static
final
String
TYPE_COMMIT
=
"commit"
;
...
...
@@ -361,17 +362,9 @@ public class Repository {
}
break
;
case
AUTHOR_TIME:
authorInstant
=
Instant
.
ofEpochSecond
(
lineScanner
.
nextLong
());
if
(
authorTZ
!=
null
)
{
commit
.
setAuthorTime
(
OffsetDateTime
.
ofInstant
(
authorInstant
,
authorTZ
));
}
break
;
case
AUTHOR_TZ:
authorTZ
=
ZoneId
.
of
(
lineScanner
.
next
());
if
(
authorInstant
!=
null
)
{
commit
.
setAuthorTime
(
OffsetDateTime
.
ofInstant
(
authorInstant
,
authorTZ
));
}
break
;
case
COMMITTER:
commit
.
setCommitter
(
lineScanner
.
nextLine
().
trim
());
...
...
@@ -382,25 +375,26 @@ public class Repository {
}
break
;
case
COMMITTER_TIME:
committerInstant
=
Instant
.
ofEpochSecond
(
lineScanner
.
nextLong
());
if
(
committerTZ
!=
null
)
{
commit
.
setCommitterTime
(
OffsetDateTime
.
ofInstant
(
committerInstant
,
committerTZ
));
}
break
;
case
COMMITTER_TZ:
committerTZ
=
ZoneId
.
of
(
lineScanner
.
next
());
if
(
committerInstant
!=
null
)
{
commit
.
setCommitterTime
(
OffsetDateTime
.
ofInstant
(
committerInstant
,
committerTZ
));
}
break
;
case
FILENAME:
commitFile
=
dir
.
toPath
().
resolve
(
Paths
.
get
(
lineScanner
.
nextLine
().
trim
())).
toFile
();
break
;
case
MESSAGE:
commit
.
setMessage
(
lineScanner
.
nextLine
().
trim
());
break
;
default
:
other
.
put
(
headerKey
,
lineScanner
.
nextLine
().
trim
());
}
}
if
(
authorInstant
!=
null
&&
authorTZ
!=
null
)
{
commit
.
setAuthorTime
(
OffsetDateTime
.
ofInstant
(
authorInstant
,
authorTZ
));
}
if
(
committerInstant
!=
null
&&
committerTZ
!=
null
)
{
commit
.
setCommitterTime
(
OffsetDateTime
.
ofInstant
(
committerInstant
,
committerTZ
));
}
// Read the line starting with a TAB and store it in a BlameLine along with its commit.
BlameLine
bLine
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment