Skip to content

Commit 379421f

Browse files
author
TheSnoozer
committed
git-commit-id/git-commit-id-maven-plugin#624: downgrade some log messages from info to debug; Jgit is way chattier than the native git implementation, by downgrading we somewhat make them more equal
1 parent dd8f2e5 commit 379421f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/main/java/pl/project13/core/jgit/DescribeCommand.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private DescribeCommand(@Nonnull String evaluateOnCommit, @Nonnull Repository re
114114
@Nonnull
115115
public DescribeCommand always(boolean always) {
116116
this.alwaysFlag = always;
117-
log.info(String.format("--always = %s", always));
117+
log.debug(String.format("--always = %s", always));
118118
return this;
119119
}
120120

@@ -136,7 +136,7 @@ public DescribeCommand always(boolean always) {
136136
public DescribeCommand forceLongFormat(@Nullable Boolean forceLongFormat) {
137137
if (forceLongFormat != null && forceLongFormat) {
138138
this.forceLongFormat = true;
139-
log.info(String.format("--long = %s", true));
139+
log.debug(String.format("--long = %s", true));
140140
}
141141
return this;
142142
}
@@ -161,7 +161,7 @@ public DescribeCommand abbrev(@Nullable Integer n) {
161161
if (n < 0) {
162162
throw new IllegalArgumentException("N (commit abbrev length) must be positive! (Was [" + n + "])");
163163
}
164-
log.info(String.format("--abbrev = %s", n));
164+
log.debug(String.format("--abbrev = %s", n));
165165
abbrev = n;
166166
}
167167
return this;
@@ -202,7 +202,7 @@ public DescribeCommand abbrev(@Nullable Integer n) {
202202
public DescribeCommand tags(@Nullable Boolean includeLightweightTagsInSearch) {
203203
if (includeLightweightTagsInSearch != null && includeLightweightTagsInSearch) {
204204
tagsFlag = includeLightweightTagsInSearch;
205-
log.info(String.format("--tags = %s", includeLightweightTagsInSearch));
205+
log.debug(String.format("--tags = %s", includeLightweightTagsInSearch));
206206
}
207207
return this;
208208
}
@@ -246,7 +246,7 @@ public DescribeCommand apply(@Nullable GitDescribeConfig config) {
246246
@Nonnull
247247
public DescribeCommand dirty(@Nullable String dirtyMarker) {
248248
Optional<String> option = Optional.ofNullable(dirtyMarker);
249-
log.info(String.format("--dirty = %s", option.orElse("")));
249+
log.debug(String.format("--dirty = %s", option.orElse("")));
250250
this.dirtyOption = option;
251251
return this;
252252
}
@@ -262,7 +262,7 @@ public DescribeCommand dirty(@Nullable String dirtyMarker) {
262262
public DescribeCommand match(@Nullable String pattern) {
263263
if (!"*".equals(pattern)) {
264264
matchOption = Optional.ofNullable(pattern);
265-
log.info(String.format("--match = %s", matchOption.orElse("")));
265+
log.debug(String.format("--match = %s", matchOption.orElse("")));
266266
}
267267
return this;
268268
}

src/main/java/pl/project13/core/jgit/JGitCommon.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ protected String createMatchPattern(String pattern) {
124124
protected Map<ObjectId, List<String>> findTagObjectIds(@Nonnull Repository repo, boolean includeLightweightTags, String matchPattern) {
125125
Map<ObjectId, List<DatedRevTag>> commitIdsToTags = getCommitIdsToTags(repo, includeLightweightTags, matchPattern);
126126
Map<ObjectId, List<String>> commitIdsToTagNames = transformRevTagsMapToDateSortedTagNames(commitIdsToTags);
127-
log.info(String.format("Created map: [%s]", commitIdsToTagNames));
127+
log.debug(String.format("Created map: [%s]", commitIdsToTagNames));
128128

129129
return commitIdsToTagNames;
130130
}
@@ -137,7 +137,7 @@ protected RevCommit findEvalCommitObjectId(@Nonnull String evaluateOnCommit, @No
137137
RevCommit evalCommit = walk.parseCommit(evalCommitId);
138138
walk.dispose();
139139

140-
log.info(String.format("evalCommit is [%s]", evalCommit.getName()));
140+
log.debug(String.format("evalCommit is [%s]", evalCommit.getName()));
141141
return evalCommit;
142142
}
143143
} catch (IOException ex) {
@@ -153,7 +153,7 @@ protected Map<ObjectId, List<DatedRevTag>> getCommitIdsToTags(@Nonnull Repositor
153153

154154
List<Ref> tagRefs = Git.wrap(repo).tagList().call();
155155
Pattern regex = Pattern.compile(matchPattern);
156-
log.info(String.format("Tag refs [%s]", tagRefs));
156+
log.debug(String.format("Tag refs [%s]", tagRefs));
157157

158158
for (Ref tagRef : tagRefs) {
159159
walk.reset();
@@ -168,7 +168,7 @@ protected Map<ObjectId, List<DatedRevTag>> getCommitIdsToTags(@Nonnull Repositor
168168
try {
169169
final RevTag revTag = walk.parseTag(resolvedCommitId);
170170
ObjectId taggedCommitId = revTag.getObject().getId();
171-
log.info(String.format("Resolved tag [%s] [%s], points at [%s] ", revTag.getTagName(), revTag.getTaggerIdent(), taggedCommitId));
171+
log.debug(String.format("Resolved tag [%s] [%s], points at [%s] ", revTag.getTagName(), revTag.getTaggerIdent(), taggedCommitId));
172172

173173
// sometimes a tag, may point to another tag, so we need to unpack it
174174
while (isTagId(taggedCommitId)) {
@@ -185,7 +185,7 @@ protected Map<ObjectId, List<DatedRevTag>> getCommitIdsToTags(@Nonnull Repositor
185185
// it's an lightweight tag! (yeah, really)
186186
if (includeLightweightTags) {
187187
// --tags means "include lightweight tags"
188-
log.info(String.format("Including lightweight tag [%s]", name));
188+
log.debug(String.format("Including lightweight tag [%s]", name));
189189

190190
DatedRevTag datedRevTag = new DatedRevTag(resolvedCommitId, name);
191191

@@ -201,7 +201,7 @@ protected Map<ObjectId, List<DatedRevTag>> getCommitIdsToTags(@Nonnull Repositor
201201
}
202202

203203
for (Map.Entry<ObjectId, List<DatedRevTag>> entry : commitIdsToTags.entrySet()) {
204-
log.info(String.format("key [%s], tags => [%s] ", entry.getKey(), entry.getValue()));
204+
log.debug(String.format("key [%s], tags => [%s] ", entry.getKey(), entry.getValue()));
205205
}
206206
return commitIdsToTags;
207207
} catch (Exception e) {

0 commit comments

Comments
 (0)