kennknowles commented on pull request #13134:
URL: https://github.com/apache/beam/pull/13134#issuecomment-714902272


   Great ideas.
   
   I learned a bit from:
   
    - 
https://stackoverflow.com/questions/20929176/how-can-i-find-modified-lines-that-match-a-certain-pattern-with-git
    - 
https://stackoverflow.com/questions/36932309/how-do-i-git-add-only-lines-matching-a-pattern
 
    - 
https://stackoverflow.com/questions/13955390/git-grep-but-restricted-to-new-or-modified-files-in-the-index
    - https://stackoverflow.com/questions/1751397/git-grep-cached
   
   In particular, I did not know about `git grep` or `git diff-index` at all. 
Now I do, I guess? I never did figure out exactly how to do what you suggest in 
one go. Perhaps the best way to check that I got it is to separate PRs...
   
   The enabling (somewhat of a leap of faith?) which I will later `rebase -i` 
to come after the rest.
   
   ```
   git reset HEAD^
   git status | grep build.gradle | cut -d : -f 2 | xargs git add
   git commit -m 'Enable checkerframework globally'
   ```
   
   I figured out I could commit everything that wasn't a new suppression 
(interactively, somewhat tedious but far less than 2k files)
   
   ```
   git add -p $(git diff-index -G ' .*Nullable.*' HEAD | cut -d ' ' -f 5 | cut 
-f 2)
   ```
   
   And the API surface checks all include a new line of `pruningPattern`
   
   ```
   git diff-index -SpruningPattern HEAD
   ```
   
   (needed to tweak interactively)
   
   ```
   git commit -m 'Allow checkerframework on API surfaces'
   ```
   
   Confirmation that the only things remaining are suppressions at the top 
level:
   
   ```
   git diff -U0 | grep '^[+][^+]' | grep -v '@SuppressWarnings'
   ```
   
   (oops there were a few more, which I isolated and committed)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to