Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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] Wed, 06 January 2016 04:17
Anurag Jain is currently offline Anurag JainFriend
Messages: 1
Registered: January 2016
Junior Member
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 05:33]

Report message to a moderator

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


Current Time: Fri Apr 19 20:31:06 GMT 2024

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

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

Back to the top