Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] CommitCommand -uno option

Hi Matthias,

Please find the answers inline:


On Thu, Aug 18, 2016 at 8:29 PM, Matthias Sohn <matthias.sohn@xxxxxxxxx> wrote:
The configuration parser will parse the option but StatusCommand doesn't handle it.

Creating a commit shouldn't take a long time.
  • Did you add the modifications you want to commit to the index before running the CommitCommand ?
[Answer] We add the modifications using AddCommand, I don't know what you meant by index
  • What's the size of your repository and what is the size of the slow commit ?
[Answer]  Size of repository : 2.9G, number of files: 435024. Let's say the slow commit has changes in appx. 10-20 files.
  • Are you using a local filesystem or some network filesystem ?
[Answer] Local filesystem. 
  • Which OS are you using ?
[Answer] Ubuntu 14.04.2 
  • Which JGit version are you using ?
[Answer] Jgit version: 4.2

-Matthias

On Thu, Aug 18, 2016 at 12:51 PM, Amit Kumar <amit.kumar@xxxxxxxxxxxxxx> wrote:
Thanks for your reply, but I am actually looking to use this option to reduce the git status and git commit time from some code that uses jgit library and does a commit using CommitCommand.

So, I actually tried to do update the git configs using the command "git config status.showUntrackedFiles no". When I print the StoredConfig being used by the jgit library it does print this config as well showing as:

//more configs

status.showuntrackedfiles=no

//more configs

So, is it actually using this config while doing git status and git commit using StatusCommand and CommitCommand ?

Actually, I am facing some speed issue in jgit, a single commit is taking around 5-6 seconds.

Regards

On Thu, Aug 18, 2016 at 2:41 PM, Matthias Sohn <matthias.sohn@xxxxxxxxx> wrote:
On Thu, Aug 18, 2016 at 8:38 AM, Amit Kumar <amit.kumar@xxxxxxxxxxxxxx> wrote:
Hi All,

In git commit or git status commands, by using -uno option we can ignore untracked files. Please help me in understanding how to add this option using CommitCommand or StatusCommand.


Option -uno isn't available directly on StatusCommand and CommitCommand.
Though it is available on status commaond in JGit command line interface (see class org.eclipse.jgit.pgm.Status).

You can implement this option on your own:

StatusCommand.call() returns a Status object. Use this Status object to identify the changes you want
to commit. Stage these changes using AddCommand and then run CommitCommand to commit the
staged changes.

-Matthias



Regards

Back to the top