The "Git Undo" functionality would certainly use the GitFacet, because you would only want to activate Undo support when working on a Project.<br><br><b>Some information about Facets:</b><br><ul><li>Facets represent project state (E.g. Git is installed. Java is installed. Servlet is installed)<br>
</li><li>Facets do not work outside of projects.</li><li>Facets avoid doing anything that prints to the shell output (sometimes it is unavoidable)<br></li><li>Facets are for encapsulating additional functionality that is usable in one or more plugins</li>
</ul><p>With that said, only some of the additional methods you suggested are not really appropriate for a Facet:<br>
</p><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><p>- showLatestDiff()<br></p></blockquote><div>probably not appropriate because it would print output - this should go into the GitPlugin instead<br>
</div><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><p>
- showLatestCommit()<br></p></blockquote><div></div><div>Probably not appropriate because it would print output - this should go into the GitPlugin instead</div><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<p>
- getNotes()<br></p></blockquote><div>Not sure what this does. <br></div><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><p>
- showLog()<br></p></blockquote><div>
<div>Probably not appropriate because it would print output - this should go into the GitPlugin instead</div></div><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<p>
- switchBranch()<br></p></blockquote><div>Appropriate as an API, but not if it requires user input - this is potentially a good method and in line with being appropriate for a Facet.</div><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<p>
- cleanWorkingDirectory()</p></blockquote><div>Not exactly sure what this would do, but yes, sounds in line with being appropriate for a Facet.<br> </div><p>Does that help? :)<br></p><p>~Lincoln<br></p><div class="gmail_quote">
On Fri, Apr 20, 2012 at 4:52 PM, Jevgeni Zelenkov <span dir="ltr"><<a href="mailto:jevgeni.zelenkov@googlemail.com">jevgeni.zelenkov@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Lincoln,<br>
<br>
Thanks for the explanation, that helped me to understand it but not<br>
completely. So, what do you actually mean by "inspect the state of a<br>
Project"?<br>
<br>
I take methods provided by you:<br>
- getBranches()<br>
- getTags()<br>
- getRemotes()<br>
- getStatus()<br>
<br>
And here are some more suggestions to help inspect the state of a project:<br>
- showLatestDiff()<br>
- showLatestCommit()<br>
- getNotes()<br>
- showLog()<br>
- switchBranch()<br>
- cleanWorkingDirectory()<br>
<br>
Would that be enough?<br>
I guess, I don't understand the use cases for the GitFacet yet.<br>
Who is going to use it and what are the potential scenarios? The git<br>
undo plugin will require a lot more than that. And I assume that<br>
GitFacet is not really a wrapper for the jGit functionality.<br>
<br>
Regards,<br>
Jevgeni<br>
<br>
On 04/20/2012 06:00 PM, <a href="mailto:forge-dev-request@lists.jboss.org">forge-dev-request@lists.jboss.org</a> wrote:<br>
> Message: 5<br>
> Date: Fri, 20 Apr 2012 09:21:10 -0400<br>
> From: "Lincoln Baxter, III"<<a href="mailto:lincolnbaxter@gmail.com">lincolnbaxter@gmail.com</a>><br>
> Subject: Re: [forge-dev] GitPlugin Facet<br>
> To: forge-dev List<<a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a>><br>
> Message-ID:<br>
> <<a href="mailto:CAEp_U4GGVD8p8hH2M5PRm6gK_MkDGtAyXzokGcm3VVz70jeX2g@mail.gmail.com">CAEp_U4GGVD8p8hH2M5PRm6gK_MkDGtAyXzokGcm3VVz70jeX2g@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="iso-8859-1"<br>
><br>
> Hey Jevgeni,<br>
><br>
> Welcome!<br>
><br>
> Regarding the GitFacet - I believe it's in the right place for the moment,<br>
> but I don't believe that the GitPlugin should be referencing it, since the<br>
> commands in GitPlugin could be used even without a Project.<br>
><br>
> GitFacet (as the issue describes poorly) is something that should be usable<br>
> to inspect the state of a Project via:<br>
><br>
> project.hasFacet(GitFacet.class)<br>
><br>
> After that, everything else is an added benefit. It should probably also<br>
> perform tasks like:<br>
><br>
> project.getFacet(GitFacet.class).getBranches()<br>
> project.getFacet(GitFacet.class).getTags()<br>
> project.getFacet(GitFacet.class).getRemotes()<br>
> project.getFacet(GitFacet.class).getStatus()<br>
><br>
> And that's where your imagination kicks in.<br>
><br>
> Does that make sense?<br>
><br>
> ~Lincoln<br>
<br>
_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>"Simpler is better."<br>