Bug 254703

Summary: pre-commit hook should not add unstaged changes from pbxproj files to index
Product: WebKit Reporter: Elliott Williams <emw>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, jbedard, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=239975
Bug Depends on: 239975    
Bug Blocks:    

Description Elliott Williams 2023-03-29 16:23:56 PDT
Currently, if changes to an Xcode project are staged, the entire pbxproj is sorted and git-added to the index. This makes it difficult to commit some parts of a pbxproj while leaving other changes unstaged.
Comment 1 Radar WebKit Bug Importer 2023-04-05 16:24:17 PDT
<rdar://problem/107684149>
Comment 2 Jonathan Bedard 2023-05-02 08:37:22 PDT
This was something SVN did, we did this for pure-git checkouts in https://bugs.webkit.org/show_bug.cgi?id=239975. Looks like it's the very bottom of Tools/Scripts/hooks/pre-commit that is the offending bit of code. Not quite sure how to address this while retaining the sorting behavior, because it seems like Elliott's ask here makes the sorting behavior impossible...
Comment 3 Elliott Williams 2023-05-05 10:42:31 PDT
> Not quite sure how to address this while retaining the sorting behavior, because it seems like Elliott's ask here makes the sorting behavior impossible…

I think what it needs to do is read the index copy (`git show :foo.xcodeproj/project.pbxproj`), sort *that*, and git-add it.