[Webkit-unassigned] [Bug 138373] Add the ability to search for modifications that are staged for commit in git.py

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 4 19:49:59 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=138373

Daniel Bates <dbates at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #240951|review?                     |review-
              Flags|                            |

--- Comment #2 from Daniel Bates <dbates at webkit.org> ---
Comment on attachment 240951
  --> https://bugs.webkit.org/attachment.cgi?id=240951
Patch to add a method for finding modified files staged for commit

View in context: https://bugs.webkit.org/attachment.cgi?id=240951&action=review

> Tools/ChangeLog:9
> +        Reviewed by NOBODY (OOPS!).

Nit: The Reviewed by line should come after the bug URL. An example of this can be seen in the change log entry for <http://trac.webkit.org/changeset/175601>.

> Tools/Scripts/webkitpy/common/checkout/scm/git.py:213
> +    def modifications_staged_for_commit(self):
> +        status_command = [self.executable_name, 'status']
> +        modified_regexp = '^\s*modified:\s+(?P<filename>.+)\s*$'
> +        return self.run_status_and_extract_filenames(status_command, modified_regexp)

Consider the following output from git status:

[[
plasma:gitTest dbates$ git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    modified:   t1

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   t2
]]

Then this function will return the array ["t1", "t2"]. That is, this function will return the filenames of modified files that are staged for commit ("Changes to be committed") and not staged for commit.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141105/dc83ba59/attachment-0002.html>


More information about the webkit-unassigned mailing list