# Is there a way of telling if changes, saved in text files, will conflict?

**URL:** <https://discourse.pijul.org/t/is-there-a-way-of-telling-if-changes-saved-in-text-files-will-conflict/1109>\
**Category:** Question\
**Created:** [October 7, 2023, 10:37pm UTC](https://discourse.pijul.org/t/is-there-a-way-of-telling-if-changes-saved-in-text-files-will-conflict/1109 "2023-10-07T22:37:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tucker-m](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/tucker-m/32/356_2.png) [@tucker-m](https://discourse.pijul.org/u/tucker-m)\
**Post date:** [October 7, 2023, 10:37pm UTC](https://discourse.pijul.org/t/is-there-a-way-of-telling-if-changes-saved-in-text-files-will-conflict/1109/1 "2023-10-07T22:37:36Z")

</div>

Kind of an open-ended question here, but I’m wondering if anyone can think of a smooth way of solving this problem.

Let’s say I’ve made a large edit, I haven’t recorded it yet, and I want to record it as two separate changes.

I’ll use `pijul diff` to produce two text files containing the full change, and then manually edit the diff in each file to make them contain only the diff I want for each separate change.

```bash
pijul diff > first_change.txt
pijul diff > second_change.txt

```

When I’m editing first\_change.txt and second\_change.txt, I need to make sure that no part of their diffs overlap, otherwise when I apply those changes (by piping them into `pijul apply`), I end up with something like this:

```txt
>>>>>>> 1 [JANJFQZE]
first line, FIRST CHANGE
======= 1 [MIA2HY74]
first line, FIRST CHANGE
<<<<<<< 1
another line
SECOND CHANGE

```

I meant for “FIRST CHANGE” to be applied by first\_change.txt, and “SECOND CHANGE” to be applied by second\_change.txt. But I forgot to take the “FIRST CHANGE” hunk out of second\_change.txt, so now I have a conflict, even though the lines are the same.

Which brings me to my question: can anyone thing of a slick way of verifying that first\_change.txt and second\_change.txt will not conflict?

---

<div class="post-metadata">

**Author:** ![burdges](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/burdges/32/242_2.png) [@burdges](https://discourse.pijul.org/u/burdges)\
**Post date:** [May 2, 2024, 1:19am UTC](https://discourse.pijul.org/t/is-there-a-way-of-telling-if-changes-saved-in-text-files-will-conflict/1109/2 "2024-05-02T01:19:12Z")

</div>

There is a more specific question: Can you have two repos X and Y with identical snapshots, and a patch C, so that C conflicts with X but not Y. It’s impossible if X and Y were built from the same series of patches, but it’s likely possible if pujil remembers & uses additional information about the repository history.
