#2960 accepted defect

RSB: Reports modified Git version in case RSB is a Git submodule

Reported by: Sebastian Huber Owned by: Chris Johns
Priority: normal Milestone: Indefinite
Component: tool/rsb Version: 6
Severity: normal Keywords:
Cc: Blocked By:


In case the RSB is used as a Git submodules the git status yields

git status
# HEAD detached at b64b38e
nothing to commit, working directory clean

leading to

RTEMS Source Builder - Set Builder, 4.12 (b64b38ef076c modified)

Change History (9)

comment:1 Changed on Mar 30, 2017 at 8:44:03 PM by Chris Johns

Is the bug you would like fixed the modified being added to the git hash?

comment:2 in reply to:  1 Changed on Mar 31, 2017 at 4:55:34 AM by Sebastian Huber

Replying to Chris Johns:

Is the bug you would like fixed the modified being added to the git hash?

Yes I think so, nothing is modified. I had some problems to understand the git.status() function in git.py.

comment:3 Changed on Mar 31, 2017 at 4:59:40 AM by Chris Johns

The status function should return a dict of discovered states. I wonder if the last elif should be an if?

comment:4 Changed on Jun 8, 2017 at 9:09:54 AM by Sebastian Huber

I tried to fix this, but I have no idea what repo.status() is supposed to do (especially the last elif part).

comment:5 in reply to:  4 Changed on Sep 22, 2017 at 1:27:03 AM by Chris Johns

Replying to Sebastian Huber:

I have no idea what repo.status() is supposed to do (especially the last elif part).

The last elif part when there is a valid state picks of the content of a section of the status output. For example:

Untracked files:
  (use "git add <file>..." to include in what will be committed)


The _state is selected and then the contents of the state are parsed and added to the state or a new state is selected.

comment:6 Changed on Sep 22, 2017 at 1:45:26 AM by Chris Johns

I can ignore a detached HEAD as condition for being dirty. That seems reasonable.

I will also ignore untracked files. They should be ignored in a build if nothing is modified. It does assume the build is not modified by untracked files. Untracked cannot be easily handled as I cannot look into the files or make assumptions. This is a change to the initial implementation but I am seeing tool builds with up to date repos that have untracked files like logs, or patches and that is not a true indication of the state. Needing a completely clean directory does seem a little onerous.

Is a modified submodule considered dirty? I think so. For example:

$ git st
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)

        modified:   freebsd-org (new commits, untracked content)

comment:7 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber


Milestone renamed

comment:8 Changed on Oct 14, 2018 at 12:54:02 AM by Chris Johns

Status: newaccepted

comment:9 Changed on Oct 19, 2018 at 12:10:54 AM by Chris Johns

Milestone: 5.1Indefinite
Version: 6
Note: See TracTickets for help on using tickets.