[Bug 229230] newvers falsely appends "-dirty" to hash when building in a git tree with no content changes

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jun 22 14:24:10 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229230

            Bug ID: 229230
           Summary: newvers falsely appends "-dirty" to hash when building
                    in a git tree with no content changes
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: bugs at FreeBSD.org
          Reporter: emaste at freebsd.org

For git trees newvers.sh attempts to report that the sources used to build do
not exactly match a commit hash (and append -dirty to the hash) via:

        if $git_cmd --work-tree=${VCSDIR}/.. diff-index \
            --name-only HEAD | read dummy; then
                git="${git}-dirty"
                modified=true
        fi

However this falsely reports that the tree is modified if metadata on a file
does not match git's expectation - for example, I have no changes in a tree:

% git diff-index --name-only HEAD
% git diff
% 

Touch a file:

% touch sys/sys/param.h
%

Now diff-index --name-only HEAD returns the touched file:

% git diff-index --name-only HEAD
sys/sys/param.h
% 

But there are actually no changes:

% git diff
%

And running 'git diff' clears the "metadata changed" status:

% git diff-index --name-only HEAD
%

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list