Skip to content

Commit 8d47bd5

Browse files
committed
refactor: use --format=<format> instead of --pretty=format:<format>
Signed-off-by: leo <[email protected]>
1 parent 808302c commit 8d47bd5

File tree

7 files changed

+8
-10
lines changed

7 files changed

+8
-10
lines changed

src/Commands/QueryCommitFullMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public QueryCommitFullMessage(string repo, string sha)
66
{
77
WorkingDirectory = repo;
88
Context = repo;
9-
Args = $"show --no-show-signature --pretty=format:%B -s {sha}";
9+
Args = $"show --no-show-signature --format=%B -s {sha}";
1010
}
1111

1212
public string Result()

src/Commands/QueryCommitSignInfo.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace SourceGit.Commands
1+
namespace SourceGit.Commands
42
{
53
public class QueryCommitSignInfo : Command
64
{
@@ -9,7 +7,7 @@ public QueryCommitSignInfo(string repo, string sha, bool useFakeSignersFile)
97
WorkingDirectory = repo;
108
Context = repo;
119

12-
const string baseArgs = "show --no-show-signature --pretty=format:\"%G?%n%GS%n%GK\" -s";
10+
const string baseArgs = "show --no-show-signature --format=%G?%n%GS%n%GK -s";
1311
const string fakeSignersFileArg = "-c gpg.ssh.allowedSignersFile=/dev/null";
1412
Args = $"{(useFakeSignersFile ? fakeSignersFileArg : string.Empty)} {baseArgs} {sha}";
1513
}

src/Commands/QueryCommits.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public QueryCommits(string repo, string filter, Models.CommitSearchMethod method
4848

4949
WorkingDirectory = repo;
5050
Context = repo;
51-
Args = $"log -1000 --date-order --no-show-signature --decorate=full --pretty=format:%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%s " + search;
51+
Args = $"log -1000 --date-order --no-show-signature --decorate=full --format=%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%s " + search;
5252
_findFirstMerged = false;
5353
}
5454

src/Commands/QueryCommitsForInteractiveRebase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public QueryCommitsForInteractiveRebase(string repo, string on)
1111

1212
WorkingDirectory = repo;
1313
Context = repo;
14-
Args = $"log --date-order --no-show-signature --decorate=full --pretty=format:\"%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%B%n{_boundary}\" {on}..HEAD";
14+
Args = $"log --date-order --no-show-signature --decorate=full --format=\"%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%B%n{_boundary}\" {on}..HEAD";
1515
}
1616

1717
public List<Models.InteractiveCommit> Result()

src/Commands/QuerySingleCommit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public QuerySingleCommit(string repo, string sha)
88
{
99
WorkingDirectory = repo;
1010
Context = repo;
11-
Args = $"show --no-show-signature --decorate=full --pretty=format:%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%s -s {sha}";
11+
Args = $"show --no-show-signature --decorate=full --format=%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%s -s {sha}";
1212
}
1313

1414
public Models.Commit Result()

src/Commands/QueryStashes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public QueryStashes(string repo)
99
{
1010
WorkingDirectory = repo;
1111
Context = repo;
12-
Args = "stash list --pretty=format:%H%n%P%n%ct%n%gd%n%s";
12+
Args = "stash list --format=%H%n%P%n%ct%n%gd%n%s";
1313
}
1414

1515
public List<Models.Stash> Result()

src/Commands/Statistics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public Statistics(string repo, int max)
88
{
99
WorkingDirectory = repo;
1010
Context = repo;
11-
Args = $"log --date-order --branches --remotes -{max} --pretty=format:\"%ct$%aN\"";
11+
Args = $"log --date-order --branches --remotes -{max} --format=%ct$%aN";
1212
}
1313

1414
public Models.Statistics Result()

0 commit comments

Comments
 (0)