What about Git support?

Are you missing a feature? Request its implementation here.
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: What about Git support?

Post by chrispitude »

Thank you Alex!! This post is exactly what I'm looking for. I'll wait for the new Git plugin (waiting is easier than downgrading) and give it a shot.

I'm going to investigate using WSL bash scripts and/or Python for Windows scripts to implement the pre-commit checks. I'll reply back here with my findings.
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: What about Git support?

Post by chrispitude »

The challenge for pre-commit hooks in Oxygen is that most pre-commit scripts rely on various

Code: Select all

git
commands to query aspects of the commit and repo. However, there is no such command available to run in an Oxygen/Git client (unless you supply an external environment on each writer's machine).

Is there any way to run JGit from a command line?
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: What about Git support?

Post by alex_jitianu »

Hi Chris,

You can run Git commands from the command line using JGit, but the required files are not bundled inside Oxygen's Git client. For example:
- You can download a Self-contained command line executable. On windows, it can be run through CYGWIN:

Code: Select all

bash.exe jgit.sh status
- You can download all jars required by the command line package and build a Java process command line.
I assume you are trying to avoid installing an external Git client on each writer machine... Will you still use Git hooks? If the answer is yes and your writers are on Windows, they will still need CYGWIN installed and added inside the path (JGit assumes the hooks are bash scripts and uses CYGWIN to execute them).

What exactly do you want to execute on the pre-commit hook?

Best regards,
Alex
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: What about Git support?

Post by chrispitude »

Hi Alex,

I am trying to avoid the use of external Git clients for two reasons.

(1) I've tried to use the following Git clients in parallel:
  • JGit in the Oxygen Git plugin
  • Git for Windows
  • Git in Ubuntu linux, via WSL (Windows Subsystem for Linux)
but I get weird interactions where one client reports files as locally changed but another reports no differences. The differences are always in the line endings (CR/LF versus LF). Sometimes, this happens to dozens or hundreds files. I haven't had time to investigate the repo's configuration file to see if a setting can be changed to fix this.

(2) As you point out, I don't want to deploy an external Git client to 40+ writers, most of whom are nontechnical. :)

The self-contained JGit executable looks interesting - I'll have a look, thank you!

For the pre-commit script language, we will use Python for Windows instead of Cygwin. We are creating other author-helping utilities in Python, so it will already be installed.

Our pre-commit script will need to determine the list of files included in the commit. Thus, we would run a command like the following (also shown in Git's .git/hooks/pre-commit.sample example hook):

Code: Select all

git diff --cached --name-only -z --diff-filter <flags_of_interest>
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: What about Git support?

Post by chrispitude »

Hi Alex,

While looking into Git submodules:

post58267.html?hilit=git%20plugin#p58267

I think I figured out that differences in LF/CRLF line endings were the cause of my Git client interaction issues. I will retry my sparse checkout experiments to see if they work, and I'll report my findings here!
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: What about Git support?

Post by chrispitude »

I do have two strongly wanted enhancement requests:

1. Auto-pulling remote non-conflicting commits would be very helpful. Despite repeated requests, many writers still go days between pulls. Our commit graphs have many parallel and intertwining nonsynchronized paths because of this. Debugging commit issues is terrible because of this.

2. When doing any Compare operation from the Git plugin, we really need the left and right sides labeled as "Mine" and "Theirs" -- always from the perspective of the writer, adjusting for whether a Merge Pull or Rebase Pull is being performed.

These would help us enormously.

And speaking of merge versus rebase... we are probably going to switch our writers from using Merge Pulls to Rebase Pulls. During conflict resolution, we had a writer become confused at the many files shown in the Staged list during conflict resolution (all the Theirs files in the catch-up commit). He discarded them because he didn't want them to be changed, but this caused all the changes in those files to become undone. Because a Rebase Pull shows the writer's changes in the staged list catch-up commit instead of the inverse, this should be less confusing to the writer.

Thank you!
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: What about Git support?

Post by alex_jitianu »

Hi Chris,
Auto-pulling remote non-conflicting commits would be very helpful. Despite repeated requests, many writers still go days between pulls. Our commit graphs have many parallel and intertwining nonsynchronized paths because of this. Debugging commit issues is terrible because of this.
I've added your feedback on the issue. I'll bring it into discussion during the next planning session. I'm not sure if I mentioned this before, but you could fork the plugin and add this functionality yourself. That's one benefit of having the plugin open source.
When doing any Compare operation from the Git plugin, we really need the left and right sides labeled as "Mine" and "Theirs" -- always from the perspective of the writer, adjusting for whether a Merge Pull or Rebase Pull is being performed.
At least when there is a conflict, the Diff uses URLs which contain these terms:

Code: Select all

git://Mine/add.txt
git://Theirs/add.txt
Is what we were able to do with the existing Diff API. Do you want some additional labels/markers in the dialog or is it a different situation? When the user commits in its local repository the compared URLs are like this:

Code: Select all

file:/C:/Users/.../Documents/Git-workspace/git_test/file.txt
git://IndexOrLastCommit/alex.txt
git://LastCommit/alex.txt
Best regards,
Alex
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: What about Git support?

Post by chrispitude »

Hi Alex,

In the following screenshot, I wrote "awesome" and the other person wrote "boring":

image.png
image.png (22.19 KiB) Viewed 6789 times

Even though I understand the reason for it, it's confusing for "Yours" to not have my changes on the left and "Theirs" to have my changes on the right during rebase.

Can you consider the following changes for rebase conflict resolution?
  • Use "git://YourResolved/" on the left and "git://YourOriginal/" on the right.
  • Deactivate the left-to-right copy buttons because they have no purpose in this mode (I think?).
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: What about Git support?

Post by alex_jitianu »

Hi Chris,

Both of your requests make perfect sense. I've added internal issues for both of them. The Diff Files application doesn't have an API to disable those actions, so we need to see how we can add such an API, first.

Alex
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: What about Git support?

Post by chrispitude »

chrispitude wrote: Mon Jun 01, 2020 2:39 am1. Auto-pulling remote non-conflicting commits would be very helpful. Despite repeated requests, many writers still go days between pulls.
Hi Alex,

Is it possible to raise the priority of the auto-pull option? It doesn't have to be the default, but my team is complaining quite strongly about having to manually pull.
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: What about Git support?

Post by chrispitude »

Does anyone know what causes the following issue?
image.png
image.png (54.11 KiB) Viewed 6615 times
I don't recall Oxygen or the Git plugin crashing.
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: What about Git support?

Post by alex_jitianu »

Hi Cris,
Is it possible to raise the priority of the auto-pull option? It doesn't have to be the default, but my team is complaining quite strongly about having to manually pull.
I will raise it again during the next planing. I'm not sure yet how to check if a pull will generate conflicts or not... By the way, the plugin now has an option to automatically push after a commit. Doesn't this option help a bit in avoiding those situations that automatic pull would too?
Does anyone know what causes the following
Another Git process/client might be running or it might have crashed (not necessarily Oxygen).

By the way, it would be better to start new threads whenever you have an issue/question. This thread has become so big that it is difficult to navigate it and identify specific pieces of information.
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: What about Git support?

Post by alex_jitianu »

Hello,

Version 2.3.1 of the Git Client contains fixes for two issues mentions on this thread:

1. In case of a Rebase conflict we now have URLs that make it more easy to understand what each stands for:
- the one on the left contains the MineResolved token
- the one on the right contains the MineOriginal token
2. The URL on the right is read-only and the Diff actions that would copy content into it are disabled. As a note, Oxygen version 22.1 or newer is needed for this behavior.


Best regards,
Alex
Locked