Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Jgit add "-A" like git(Does Jgit add have the "-A" option? )
Jgit add "-A" like git [message #1719190] Tue, 05 January 2016 23:17
Eclipse UserFriend
Does Jgit have a "-A" option like git?
We are currently executing:

AddCommand addCmd = git().add();
addCmd.addFilepattern(".");
DirCache retVal = addCmd.call();

CommitCommand commitCmd = git().commit();
final boolean includeDeleted = true;
commitCmd.setAll(includeDeleted);
commitCmd.setMessage(message);

final RevCommit commitResult = commitCmd.call();
String retVal = commitResult.getId().name();


In above, AddCommand is executed twice, first (by us) to account for new files or changed files and second by commit to include deleted files.

AddCommand loops over the Git repo. Based on above, we are looping twice over the repo. That is proving to be costly for us. Can we do any better w.r.t. AddCommand such that it stages new, modified, deleted files in the repo in one loop?

Any other suggestions to improve performance are invited.

Thanks!

[Updated on: Thu, 07 January 2016 00:33] by Moderator

Previous Topic:jgit doesn't handle for http authentication
Next Topic:Installation Error in Eclipse Luna 4.4.2
Goto Forum:
  


Current Time: Thu Jul 17 14:04:28 EDT 2025

Powered by FUDForum. Page generated in 0.27999 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top