Git development
 help / color / mirror / Atom feed
* How to do equivalent of "git-reset --hard" and "git revert HEAD" using jgit?
@ 2008-11-13 17:43 Farrukh Najmi
  0 siblings, 0 replies; only message in thread
From: Farrukh Najmi @ 2008-11-13 17:43 UTC (permalink / raw)
  To: git


I need some guidance on how use jgit to implement the following methods:


     /**
      * Rolls back all uncommitted changes so Index and worspace are 
rolled to committed state in HEAD version.
      * Functionally equivalent to "git reset --hard HEAD"
      *
      */
     public void rollback() {
     }

     /**
      * Undoes the last commit.
      * Functionally equivalent to "git revert HEAD"
      *
      * @param versionNameToRevertTo Version of Commit to revert to
      */
     public void revert(String versionNameToRevertTo) {
     }

It seems that I will have to walk the Tree and check status of each file 
to decide what to do with it. The TreeWalk api is not obvious from the 
javadoc.


TIA for any guidance you can provide.

-- 
Regards,
Farrukh Najmi

Web: http://www.wellfleetsoftware.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-13 17:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-13 17:43 How to do equivalent of "git-reset --hard" and "git revert HEAD" using jgit? Farrukh Najmi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox