netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Support "native" Git

Open anthonyvdotbe opened this issue 3 years ago • 9 comments

Description

Native git should be supported because:

  • JGit inevitably lags behind native git, e.g. support for "gitattributes" [1] took over 7(!) years, and there's still no support for "git worktree" [2] and "includeIf" [3][4]
  • JGit's lack of support for certain features leads to unreliable/surprising behavior and possible data loss, e.g. [5]
  • NetBeans lags behind JGit, because it needs to upgrade the bundled JGit (currently it bundles 5.7.0, while JGit is at 6.2.0)

Previous issues:

  • https://issues.apache.org/jira/browse/NETBEANS-2122
  • https://bz.apache.org/netbeans/show_bug.cgi?id=268242

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=342372 [2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=477475 [3] https://bugs.eclipse.org/bugs/show_bug.cgi?id=543171 [4] https://issues.apache.org/jira/browse/NETBEANS-4264 [5] https://bugs.eclipse.org/bugs/show_bug.cgi?id=477745

Use case/motivation

Reliable git support

Related issues

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

anthonyvdotbe avatar Aug 08 '22 13:08 anthonyvdotbe

I'm not deep enough into the features of JGit, but updating to a newer JGit will not fix most of your mentioned questions?

Chris2011 avatar Aug 08 '22 18:08 Chris2011

I'm not deep enough into the features of JGit, but updating to a newer JGit will not fix most of your mentioned questions?

Apart from the first one, all JGit issues I mentioned are still unresolved, including the one that may result in data loss.

anthonyvdotbe avatar Aug 09 '22 06:08 anthonyvdotbe

Updating to the latest JGit would also require a decision to make Git modules Java 11+. This might not be a problem.

I can see merit of also supporting CLI Git, but I'm not sure how abstracted the Git API in NetBeans is. Generally, if I want to do anything vaguely complicated I use the terminal (inside or outside NetBeans) anyway.

neilcsmith-net avatar Aug 09 '22 09:08 neilcsmith-net

Generally, if I want to do anything vaguely complicated I use the terminal (inside or outside NetBeans) anyway.

JGit is unable to interpret my git configuration correctly, so even basic things don't work as they should. (And NetBeans' terminal support on Windows leaves a lot to be desired.)

anthonyvdotbe avatar Aug 09 '22 11:08 anthonyvdotbe

What is meant by "support native GIT"? Or maybe more specifically what is the "acceptance criteria" to determine if this is been implemented as needed?

Assume this means either (1) Don't do it through JGit since JGit is delayed in adding functionality (i.e. and no one is working to update JGIT to support needed functionality available in "native git")?

(2) Have some "CLI interface" within NB to make native git calls. Is basic Tools...Open Terminal not an option here?

ebresie avatar Aug 14 '22 15:08 ebresie

Generally, if I want to do anything vaguely complicated I use the terminal (inside or outside NetBeans) anyway.

JGit is unable to interpret my git configuration correctly, so even basic things don't work as they should. (And NetBeans' terminal support on Windows leaves a lot to be desired.)

From within Netbeans, does right clicking on project, and select Git...Repository... or "Team...Repository" and select either (1) Open Configuration or (2) Open Global Configuration provide some of what is needed here?

ebresie avatar Aug 14 '22 15:08 ebresie

(And NetBeans' terminal support on Windows leaves a lot to be desired.)

What is meant here? From toying around, it seems to allow git functionality to work. Is there a specific issue or "use case" where it's not acceptable?

ebresie avatar Aug 14 '22 15:08 ebresie

So is upgrade to JGIT 6.2.0 one of the suggestions?

ebresie avatar Aug 14 '22 15:08 ebresie

What is meant by "support native GIT"? Or maybe more specifically what is the "acceptance criteria" to determine if this is been implemented as needed?

Assume this means either (1) Don't do it through JGit since JGit is delayed in adding functionality (i.e. and no one is working to update JGIT to support needed functionality available in "native git")?

(2) Have some "CLI interface" within NB to make native git calls. Is basic Tools...Open Terminal not an option here?

This means (1).

Generally, if I want to do anything vaguely complicated I use the terminal (inside or outside NetBeans) anyway.

JGit is unable to interpret my git configuration correctly, so even basic things don't work as they should. (And NetBeans' terminal support on Windows leaves a lot to be desired.)

From within Netbeans, does right clicking on project, and select Git...Repository... or "Team...Repository" and select either (1) Open Configuration or (2) Open Global Configuration provide some of what is needed here?

No, the issue is that my .gitconfig file contains includeIf sections.

(And NetBeans' terminal support on Windows leaves a lot to be desired.)

What is meant here? From toying around, it seems to allow git functionality to work. Is there a specific issue or "use case" where it's not acceptable?

See https://github.com/apache/netbeans/issues/3959 and compare this to the terminal in VS Code or IntelliJ IDEA.

So is upgrade to JGIT 6.2.0 one of the suggestions?

No, see my earlier reply:

I'm not deep enough into the features of JGit, but updating to a newer JGit will not fix most of your mentioned questions?

Apart from the first one, all JGit issues I mentioned are still unresolved, including the one that may result in data loss.

anthonyvdotbe avatar Aug 14 '22 15:08 anthonyvdotbe