2

I have installed the Git Plugin for JEdit but dont see how to make it work. I currently use the SVN Plugin and have no issues with this but work is asking for a change to gitlab.

Where do I setup the access to the gitlab repository and what is it expecting as a URL or SSH URI

1 Answers1

1

As long as you can clone that GitLab repo in command line, you are able to use the same url in the JEdit Git plugin.

So check first you can clone the repo manually:

git clone https://url/to/your/gitlab/server/user/repo

If that works, report that url in JEdit.

Looking at the sources of the JEdit Git plugin 0.7.1, I do see the:

  • "modified" icon is yellow: modified
  • "added" icon is blue: added
  • any other tracked file should be "unmodified", that is green: unmodified

Note/update April 2017: I cannot make that plugin work on Windows with the latest jdk 8 and Git for Windows 2.12.2.

I see:

16:02:37 [AWT-EventQueue-0] [debug] EditBus: PluginUpdate[what=ACTIVATED,exit=false,version=0.7.1,source=C:\Users\vonc\AppData\Roaming\jEdit\jars\GitPlugin.jar,class=git.GitPlugin]
16:03:32 [jEdit Worker #1] [debug] GitSubmoduleImporter: Running git ls-files in C:\Users\vonc\data\git\seec
16:03:43 [AWT-EventQueue-0] [debug] ActionSet: Loading actions from jeditresource:/GitPlugin.jar!/actions.xml

But when activating the Commit dialog box, the list is empty, and clicking on it triggers:

16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0: java.lang.ArrayIndexOutOfBoundsException: -1
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0:  at java.util.Vector.elementData(Vector.java:734)
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0:  at java.util.Vector.elementAt(Vector.java:477)
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0:  at javax.swing.DefaultListModel.elementAt(DefaultListModel.java:266)
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0:  at git.action.CommitAction$CommitDialog.toggle(CommitAction.java:374)
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0:  at git.action.CommitAction$CommitDialog.mouseClicked(CommitAction.java:363)
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0:  at git.action.CommitAction$CommitDialog.access$200(CommitAction.java:167)
16:04:02 [AWT-EventQueue-0] [error] AWT-EventQueue-0:  at git.action.CommitAction$CommitDialog$3.mouseClicked(CommitAction.java:285)

What concerns me is GitPlugin\git\command\OpenFileList.java which includes

    if (line.startsWith("# Changed but not updated:") ||
        line.startsWith("# Changes not staged for commit:")) {
        skip = 2;
        target = modified;
    }

Well... my prompt on Windows does not start with '#', so changes of detecting staged files become slim.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I have the same problem as OP. @VonC, can you be more specific on where should I report my url in jEdit? Thanks. btw. I can modify any files, but in "commit" it still see no modified files. – pisoir Apr 08 '17 at 11:01
  • @pisoir Modifying files is not enough for "commit" to see them as to be committed. You need to add those files to the index first (equivalent of `git add`) – VonC Apr 08 '17 at 11:45
  • @pisoir of course, make sure the files open in JEdit are part of a git repo (do a `git status` in the parent folder of the files you have changed, for instance) – VonC Apr 08 '17 at 11:54
  • Yes, I am modifying files which are already in the index. They are in the git folder and I see them on server. Also git blame in jEdit shows on the modified lines "Not Committed Yet". However, when I do "commit changes" there are no Files to commit. – pisoir Apr 08 '17 at 12:51
  • @pisoir Can you check with command line? Does git status list those same modified files as "ready to be committed" (and not as "modified, not yet staged")? – VonC Apr 08 '17 at 12:56
  • Yes, it says "Changes to be committed:" This: Changes to be committed: (use "git reset HEAD ..." to unstage) modified: e4z/get_orders.php – pisoir Apr 08 '17 at 13:18
  • I modified the file "get_orders.php" and in jEdit in ProjectViewer in shows a yellow icon (I assume meaning that it was modified), but still if I go to Plugins->Git Plugin->Commit changes, then there are no files shown as modified. – pisoir Apr 08 '17 at 13:20
  • @pisoir yes, but modified does not mean to be committed. I have edited the answer to show the relevant icons. – VonC Apr 08 '17 at 13:37
  • Thanks for explaining. Now I understand your first comment:). But how can I add it to the index through jEdit? (it is added through git add already, so I guess I have to let jEdit know somehow). I really just want modify files in jEdit, then click on commit in jEdit and it will be updated on server. If I have to do git add, git commit in a separate window then jEdit looses all the charm for me. – pisoir Apr 08 '17 at 14:19
  • @pisoir Yes, I am investigating that. I have edited the answer with what I have found so far. – VonC Apr 08 '17 at 14:27