# Projects - diff - is there a way to limit to filter to only what changed?

**URL:** <https://discourse.nodered.org/t/projects-diff-is-there-a-way-to-limit-to-filter-to-only-what-changed/59859>\
**Category:** General\
**Created:** [14 March 2022 20:03 UTC](https://discourse.nodered.org/t/projects-diff-is-there-a-way-to-limit-to-filter-to-only-what-changed/59859 "2022-03-14T20:03:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SandeepA](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sandeepa/32/63225_2.png) [@SandeepA](https://discourse.nodered.org/u/SandeepA)\
**Post date:** [14 March 2022 20:03 UTC](https://discourse.nodered.org/t/projects-diff-is-there-a-way-to-limit-to-filter-to-only-what-changed/59859/1 "2022-03-14T20:03:05Z")

</div>

Hi ,

I started using the Projects feature of NR recently. And i am amazed at it.  
Thank You for this splendid feature.  
In past i had asked for versioning and diff to be added to v3 - but now i can see Projects already covers it.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/2/f29d87392155ba3a32e98518d4ff4eb86fb8f980.png)

Some queries :-

1. Is it possible to filter above data to show only what changed. I have close to 50-60 flows. So , it would useful to see only what changed. Alternatively maybe sort the data to show only flows + subflows which changed - show them on the top.

2. Is there any connection between an uncommited change and deploy? My understanding is none. Even if the change is not commited - runtime will pick the latest changes, right ?

3. When we export such a flow file and move it to a new environment - if that environment is also having projects enabled- what would a good approach to track if all changes have come in and no local changes done on that env have been overwritten. Basically ensuring master remains correct. One option i can think is connecting to common git - but this may not be always possible. Any suggestions ? I am aware this may not be completely in the realm of core NR product - but any ideas welcome.

---

<div class="post-metadata">

**Author:** ![SandeepA](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sandeepa/32/63225_2.png) [@SandeepA](https://discourse.nodered.org/u/SandeepA)\
**Post date:** [15 March 2022 09:14 UTC](https://discourse.nodered.org/t/projects-diff-is-there-a-way-to-limit-to-filter-to-only-what-changed/59859/2 "2022-03-15T09:14:51Z")

</div>

Any response ?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [15 March 2022 10:50 UTC](https://discourse.nodered.org/t/projects-diff-is-there-a-way-to-limit-to-filter-to-only-what-changed/59859/3 "2022-03-15T10:50:21Z")

</div>

> [@SandeepA](#):
>
> Is it possible to filter above data to show only what changed. I have close to 50-60 flows. So , it would useful to see only what changed. Alternatively maybe sort the data to show only flows + subflows which changed - show them on the top.

If you are asking whether that is possible today, then as I'm sure you can see, no it isn't. But it would be useful enhancement to the view to be able to do so.

> [@SandeepA](#):
>
> Is there any connection between an uncommited change and deploy? My understanding is none. Even if the change is not commited - runtime will pick the latest changes, right ?

The runtime runs what is deployed - it doesn't care if that has been committed or not. Committing your changes is a separate task that is up to you to do.

> [@SandeepA](#):
>
> When we export such a flow file and move it to a new environment - if that environment is also having projects enabled- what would a good approach to track if all changes have come in and no local changes done on that env have been overwritten.

If you move the flow file to a new environment, then you have everything that is in the flow file (and don't forget the credentials file). That assumes you are moving the actual files. If you are exporting JSON from the editor and reimporting it via the editor, you are merging it with whatever is already there - which could lead to unexpected results if you're importing over the top of an existing set of flows.

Having a shared git repository is always going to be the cleanest way for this to work - so the remote instances just have to `git clone` to get the latest set of committed changes.

If you can't have a shared repo, then you're back to manually copying files around - either individually, or as the entire repo.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 March 2022 11:31 UTC](https://discourse.nodered.org/t/projects-diff-is-there-a-way-to-limit-to-filter-to-only-what-changed/59859/4 "2022-03-15T11:31:10Z")

</div>

If you enable `flowFilePretty` in settings.js then it can make it easier to see what is has changed.

Also if you run this shell script from the folder where your flows file is, before committing

```auto
#!/usr/bin/env sh

# generates formatted versions of node red flow files matching flow*.json
# in files flow*.json.formatted

# NOTE must have flowFilePretty: true in settings.js

for f in flow*.json; do
  echo $f
  sed -r 's/\\n/\n/g' "$f" > "$f.formatted"
done
# remove any cred files converted
rm *_cred.json.formatted

```

and also commit the `.formatted` flows file that it produces, then a diff on that will show you changes you made within function nodes, in addition to flow changes.

---

<div class="post-metadata">

**Author:** ![SandeepA](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sandeepa/32/63225_2.png) [@SandeepA](https://discourse.nodered.org/u/SandeepA)\
**Post date:** [15 March 2022 13:24 UTC](https://discourse.nodered.org/t/projects-diff-is-there-a-way-to-limit-to-filter-to-only-what-changed/59859/5 "2022-03-15T13:24:49Z")

</div>

Thank You @Colin . This works for identifying what all was changed. I will check how my team can use this for automating.

---

<div class="post-metadata">

**Author:** ![SandeepA](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sandeepa/32/63225_2.png) [@SandeepA](https://discourse.nodered.org/u/SandeepA)\
**Post date:** [15 March 2022 14:13 UTC](https://discourse.nodered.org/t/projects-diff-is-there-a-way-to-limit-to-filter-to-only-what-changed/59859/6 "2022-03-15T14:13:19Z")

</div>

Thank You @knolleary for the feedback.

1. Can you please add the #1 (filtering) to the FR ?
2. Noted. So runtime and commit have no correlation. This doesn't break anything for me. I just wanted to know this aspect. Thanks.
3. Let me explore both what both You and @Colin suggested on git clone + formatterd. Maybe use both in combination. Will check.

---

<div class="post-metadata">

**Author:** ![SandeepA](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sandeepa/32/63225_2.png) [@SandeepA](https://discourse.nodered.org/u/SandeepA)\
**Post date:** [15 March 2022 14:17 UTC](https://discourse.nodered.org/t/projects-diff-is-there-a-way-to-limit-to-filter-to-only-what-changed/59859/7 "2022-03-15T14:17:32Z")

</div>

> [@SandeepA](#):
>
> Can you please add the #1 (filtering) to the FR ?

And if may - being greedy now - can we also a FR - which allows filtering out the "cosmetic" differences. Example when a node is moved. User can filter them out of diff and focus only on the real functional differences.

Thank You once again.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 May 2022 14:18 UTC](https://discourse.nodered.org/t/projects-diff-is-there-a-way-to-limit-to-filter-to-only-what-changed/59859/8 "2022-05-14T14:18:32Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
