History

scripts/setlocalversion on write-protected source tree

I just stumbled across another[0] issue when scripts/setlocalversion operates on a write-protected source tree. Back then[0] the source tree was on an read-only NFS share, so "test -w" was introduced before "git update-index" was run. This time, the source tree is on read/write NFS share, but the permissions are world-readable and only a specific user (or root) can write. Thus, "test -w ." returns "0" and then runs "git update-index", producing the following message (on a dirty tree): fatal: Unable to create '/usr/local/src/linux-git/.git/index.lock': Permission denied While it says "fatal", compilation continues just fine. However, I don't think a kernel compilation should alter the source tree (or the .git directory) in any way and I don't see how removing "git update-index" could do any harm. The Mercurial and SVN routines in scripts/setlocalversion don't have any tree-modifying commands, AFAICS. So, maybe the patch below would be acceptable. [0] https://patchwork.kernel.org/patch/29718/

Christian Kujau committed 13 years ago

Commit cdf2bc61 parent 1c00a471 file · +0 −3Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/setlocalversion+0−3
@@ -71,9 +71,6 @@ scm_version() · 70 unmodified lines
7171 printf -- '-svn%s' "`git svn find-rev $head`"
7272 fi
7373
74− # Update index only on r/w media
75− [ -w . ] && git update-index --refresh --unmerged > /dev/null
76−
7774 # Check for uncommitted changes
7875 if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
7976 printf '%s' -dirty

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t