Prevent Committing When No Changes

Are you missing a feature? Request its implementation here.
dreifsnider
Posts: 163
Joined: Thu Aug 30, 2018 10:06 pm

Prevent Committing When No Changes

Post by dreifsnider »

Hi Oxygen Support,

My team would like to request a new feature for Web Author, specifically for the GitHub integration/plugin.

We discovered several of our users making commits that contain no changes, essentially these are "empty commits", for example:
image.png
image.png (30.71 KiB) Viewed 159 times
This isn't typical behavior for Git clients and it's made for confusing commit histories.

Would it be possible to prevent users from committing when no changes are present? Alternatively, if it's not possible to prevent users from committing, could we add a message to the commit dialog that says something along the lines of "No changes will be committed"?

Thank you!

Daniel
cosminef
Site Admin
Posts: 209
Joined: Wed Aug 30, 2023 2:33 pm

Re: Prevent Committing When No Changes

Post by cosminef »

Hello,

We have logged an internal issue (WA-8193) to prevent commits without changes.
We would also like to know the cases in which you end up having empty commits:
  • Are there cases where the document becomes dirty?
  • Or, for example, if two users modify a typo in the same file, on different branches, and when the merge is performed, merge conflicts occur?
Best,
Cosmin
Cosmin Eftenie
www.oxygenxml.com
dreifsnider
Posts: 163
Joined: Thu Aug 30, 2018 10:06 pm

Re: Prevent Committing When No Changes

Post by dreifsnider »

Hi Cosmin,

Thank you for logging an internal ticket for this.

Regarding your questions:
Are there cases where the document becomes dirty?
Not to my knowledge. I would imagine if a document became dirty, this would imply that a change had been made to the document and therefore the change would appear in GitHub as a difference/modification.
Or, for example, if two users modify a typo in the same file, on different branches, and when the merge is performed, merge conflicts occur?
I can envision this case happening, but again, if two users modify a typo, both modifications would show in GitHub as a difference and we could then trace the modification back to the user.

In the case of this issue, simply being able to open a document and then immediately make a commit for the document without making any modifications seems odd behavior. I believe Git clients would typically say "No changes to commit".

Thanks!

Daniel
cosminef
Site Admin
Posts: 209
Joined: Wed Aug 30, 2023 2:33 pm

Re: Prevent Committing When No Changes

Post by cosminef »

Hello Daniel,

Ok, thank you for your answers.
We take your suggestions into account.

Best,
Cosmin
Cosmin Eftenie
www.oxygenxml.com
Post Reply