From 0e3ddea1b028836889fc13ad56b1dec5d5438fc9 Mon Sep 17 00:00:00 2001 From: Christian Halstrick Date: Wed, 4 Mar 2015 12:43:01 +0100 Subject: Add "--long" option to JGit describe Native git supports "git describe --long". This will enforce returning a long description of a commit even if a tag is directly pointing to the commit (in contrast to just returning the tag name as it is now). This commit teaches JGits DescribeCommand and the describe command in the pgm package to support "--long". Bug: 460991 Change-Id: I65e179b79e89049c6deced3c71cb3ebb08ed0a8f Signed-off-by: Matthias Sohn --- org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Describe.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'org.eclipse.jgit.pgm/src/org') diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Describe.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Describe.java index 52e8809bef..901e5604ae 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Describe.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Describe.java @@ -48,6 +48,7 @@ import org.eclipse.jgit.api.errors.RefNotFoundException; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.pgm.internal.CLIText; import org.kohsuke.args4j.Argument; +import org.kohsuke.args4j.Option; @Command(common = true, usage = "usage_Describe") class Describe extends TextBuiltin { @@ -55,11 +56,15 @@ class Describe extends TextBuiltin { @Argument(index = 0, metaVar = "metaVar_treeish") private ObjectId tree; + @Option(name = "--long", usage = "usage_LongFormat") + private boolean longDesc; + @Override protected void run() throws Exception { DescribeCommand cmd = new Git(db).describe(); if (tree != null) cmd.setTarget(tree); + cmd.setLong(longDesc); String result = null; try { result = cmd.call(); -- cgit v1.2.3