What about Git support?
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: What about Git support?
Post by chrispitude »
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.
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: What about Git support?
Post by chrispitude »
Code: Select all
git
Is there any way to run JGit from a command line?
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: What about Git support?
Post by alex_jitianu »
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
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
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: What about Git support?
Post by chrispitude »
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)
(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>
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: What about Git support?
Post by chrispitude »
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!
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: What about Git support?
Post by chrispitude »
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!
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: What about Git support?
Post by alex_jitianu »
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.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.
At least when there is a conflict, the Diff uses URLs which contain these terms: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.
Code: Select all
git://Mine/add.txt
git://Theirs/add.txt
Code: Select all
file:/C:/Users/.../Documents/Git-workspace/git_test/file.txt
git://IndexOrLastCommit/alex.txt
git://LastCommit/alex.txt
Alex
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: What about Git support?
Post by chrispitude »
In the following screenshot, I wrote "awesome" and the other person wrote "boring":
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?).
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: What about Git support?
Post by alex_jitianu »
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
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: What about Git support?
Post by chrispitude »
Hi Alex,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.
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.
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: What about Git support?
Post by chrispitude »
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: What about Git support?
Post by alex_jitianu »
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?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.
Another Git process/client might be running or it might have crashed (not necessarily Oxygen).Does anyone know what causes the following
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.
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: What about Git support?
Post by alex_jitianu »
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
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service