diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-09-01 09:34:43 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-09-02 11:38:39 -0700 |
commit | 244b1580b5155099bfdf98692d76c1b2a6183126 (patch) | |
tree | 88525a6a9ef57e6110f9f6c83b45cd5ff85b328d /org.eclipse.jgit.pgm/src/org/eclipse | |
parent | ec2fdbf2bad632bf303ef3d394c957db7588d205 (diff) | |
download | jgit-244b1580b5155099bfdf98692d76c1b2a6183126.tar.gz jgit-244b1580b5155099bfdf98692d76c1b2a6183126.zip |
log, diff: Add --src-prefix, --dst-prefix, --no-prefix
Change-Id: I0c7154a51143d56362f12ee4fa93133778d3a9eb
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java | 16 | ||||
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java | 16 |
2 files changed, 32 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java index b6650a4ea1..ec939b37e4 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java @@ -131,6 +131,22 @@ class Diff extends TextBuiltin { diffFmt.setAbbreviationLength(Constants.OBJECT_ID_STRING_LENGTH); } + @Option(name = "--src-prefix", usage = "usage_srcPrefix") + void sourcePrefix(String path) { + diffFmt.setOldPrefix(path); + } + + @Option(name = "--dst-prefix", usage = "usage_dstPrefix") + void dstPrefix(String path) { + diffFmt.setNewPrefix(path); + } + + @Option(name = "--no-prefix", usage = "usage_noPrefix") + void noPrefix(@SuppressWarnings("unused") boolean on) { + diffFmt.setOldPrefix(""); + diffFmt.setNewPrefix(""); + } + // END -- Options shared with Log @Override diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java index 2b29f73385..8eb2e54dc5 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java @@ -139,6 +139,22 @@ class Log extends RevWalkTextBuiltin { diffFmt.setAbbreviationLength(Constants.OBJECT_ID_STRING_LENGTH); } + @Option(name = "--src-prefix", usage = "usage_srcPrefix") + void sourcePrefix(String path) { + diffFmt.setOldPrefix(path); + } + + @Option(name = "--dst-prefix", usage = "usage_dstPrefix") + void dstPrefix(String path) { + diffFmt.setNewPrefix(path); + } + + @Option(name = "--no-prefix", usage = "usage_noPrefix") + void noPrefix(@SuppressWarnings("unused") boolean on) { + diffFmt.setOldPrefix(""); + diffFmt.setNewPrefix(""); + } + // END -- Options shared with Diff Log() { |