14

I have a quick ExtJS 6 question that im hoping someone can help me with.

I am working in a multi dev team using git for source control.

I have setup a brand new Ext project via the following steps;

sencha -sdk /home/user/project/extjs-6.5.3.57 generate app Application /home/user/project/app

which builds the app, I then run sencha app watch and do some initial changes.

From there i git init a initial commit.

All seems to go well, it creates an entry in my workspace.json file like so;

"frameworks": {
    "ext": {
        "path":"ext",
        "version":"6.5.3.57"
    }

},

The problem occurs when another member of the team want to start developing.

They clone the repo, setup their sencha cmd and then run;

sencha app upgrade /home/user/project/extjs-6.5.3.57

This creates the /build and /ext directories which are in the .gitignore file.

Straight after this, if they were to run git status is returns saying that the workspace.json has been updated.

The change just seems to be checking that frameworks block and adding a few spaces. and this is the rendered block;

"frameworks": {
    "ext": {
        "path":"ext",
        "version":"6.5.3.57"
    }


},

I was wondering if anyone else has run into this and how they overcame it? .. Should i be adding workspace.json to the .gitignore file so its generated fresh on each dev's machine? or am i doing something wrong initially?

Currently my .gitignore looks like so;

/build
/ext
bootstrap.*
classic.json*
modern.json*
.sencha
.idea

I am running the sencha app upgrade from the root directory of the project, so my working directory looks like so

/.git
.gitignore
Readme.md
/app
app.js
app.json
build.xml
/classic
/ext
index.html
/modern
/resources
workspace.json

Any help would be greatly appreciated.

  • Are the generated folders in the root folder? Probably it helps if you share the specific contents of .gitignore and the relative paths of the generated folders. – Christos Batzilis Jun 01 '18 at 07:30
  • @ChristosBatzilis I have updated my question –  Jun 01 '18 at 07:54

1 Answers1

7

First, a typical ExtJS gitignore file does not include workspace.json.
So you should not ignore it.

Second, you could ask the developers to activate in their git config a clean content filter driver which would remove empty lines.

git config filter.workspacejson.clean sed '/^$/d'

That filter 'workspacejson' is declared in the Git repository as a .gitattributes directive.

workspace.json  filter=workspacejson

It will apply automatically on git diff or git commit for any workspace.json file, as specified in the .gitattributes file.

http://git-scm.com/book/en/v2/book/08-customizing-git/images/clean.png

(Source: Pro Git book: Customizing Git - Git Attributes)

That way, any git diff or git commit will consider your workspace.json unchanged.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250