# Best Practices for SVN/GIT on projects

**URL:** <https://forum.inductiveautomation.com/t/best-practices-for-svn-git-on-projects/30218>\
**Category:** Ignition\
**Created:** [November 25, 2019, 7:16pm UTC](https://forum.inductiveautomation.com/t/best-practices-for-svn-git-on-projects/30218 "2019-11-25T19:16:41Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![mwd123](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@mwd123](https://forum.inductiveautomation.com/u/mwd123)\
**Post date:** [October 13, 2022, 2:09pm UTC](https://forum.inductiveautomation.com/t/best-practices-for-svn-git-on-projects/30218/21 "2022-10-13T14:09:26Z")

</div>

What about:

from java.lang import Thread  
Thread.sleep(5000)

Etc.. better or worse?  
(Saw this in some other post that it could be better)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 13, 2022, 2:12pm UTC](https://forum.inductiveautomation.com/t/best-practices-for-svn-git-on-projects/30218/22 "2022-10-13T14:12:13Z")

</div>

Not better or worse. Just as evil. The problem is any kind of sleep (or infinite loop) tying up a thread. Event threads are typically part of a limited thread pool, impacting other tasks.

---

<div class="post-metadata">

**Author:** ![mwd123](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@mwd123](https://forum.inductiveautomation.com/u/mwd123)\
**Post date:** [October 13, 2022, 2:42pm UTC](https://forum.inductiveautomation.com/t/best-practices-for-svn-git-on-projects/30218/23 "2022-10-13T14:42:48Z")

</div>

Do you have any example using ProcessBuilder to execute code on the gateway? (like I did with system.util.execute) ?

Thanks in advance  
/M

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 13, 2022, 2:50pm UTC](https://forum.inductiveautomation.com/t/best-practices-for-svn-git-on-projects/30218/24 "2022-10-13T14:50:31Z")

</div>

From a quick search for `ProcessBuilder` on this forum:

> [@Procedure for installing python libraries from source](https://forum.inductiveautomation.com/t/procedure-for-installing-python-libraries-from-source/26022/16):
>
> Oh, right - system.util.execute is a 'fire-and-forget', it doesn't give you access to standard output. Try adapting this: from java.lang import ProcessBuilder, String pb = ProcessBuilder([r"C:\Users\pgriffith\AppData\Local\Microsoft\WindowsApps\python3.exe", r"C:\Users\pgriffith\Downloads\test.py"]) process = pb.start() output = String(process.getInputStream().readAllBytes()) print output (Note: This blocks until the process completes waiting on the input stream. It may or may not ever compl…

---

<div class="post-metadata">

**Author:** ![mwd123](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@mwd123](https://forum.inductiveautomation.com/u/mwd123)\
**Post date:** [October 13, 2022, 2:56pm UTC](https://forum.inductiveautomation.com/t/best-practices-for-svn-git-on-projects/30218/25 "2022-10-13T14:56:41Z")

</div>

Yes I checked all the posts on the forum that contains ProcessBuilder. 🙂 (I did't get any wiser doh:))

Will try to give it some more time tomorrow.

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [March 17, 2023, 3:26pm UTC](https://forum.inductiveautomation.com/t/best-practices-for-svn-git-on-projects/30218/26 "2023-03-17T15:26:44Z")

</div>

I don't see anything in the best practice white paper about what files can and/or should be staged for commits. Understanding that completely ignoring resources will break things, isn't there some sort of happy middle ground and not commit every resource.json that changes? To me it makes sense to stage only resource.json files that pair with things that actually changed. So if foo/code.py is changed, then for sure stage foo/resource.json. Or is this potentially flawed as well?

---

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [March 17, 2023, 3:38pm UTC](https://forum.inductiveautomation.com/t/best-practices-for-svn-git-on-projects/30218/27 "2023-03-17T15:38:39Z")

</div>

The approach that works for us is to treat any directory that contains a resource.json file as an atomic object: either stage/commit ALL of the files in it, or NONE of the files in it.

Usually, after doing some development work, I have a handful of directories that have been modified. I have to take a quick peek at each directory, and decide if I really wanted those changes and `git add` the whole directory, or `git restore` the whole directory if I didn't want those changes. After everything is either added or restored, I finally do a `git commit`.

If there is a directory with some changes that I want and some changes I don't want, I go back into Designer and edit that resource.

[Previous page](https://forum.inductiveautomation.com/t/best-practices-for-svn-git-on-projects/30218.md?page=1)
