Bug 254703 - pre-commit hook should not add unstaged changes from pbxproj files to index
Summary: pre-commit hook should not add unstaged changes from pbxproj files to index
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 239975
Blocks:
  Show dependency treegraph
 
Reported: 2023-03-29 16:23 PDT by Elliott Williams
Modified: 2023-05-05 10:42 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.