Adding uncommitted flag to support post staged but not commit changes

Review Request #6879 - Created Feb. 1, 2015 and updated

Tran Nguyen
RBTools
master
756835e...
rbtools

Problem:
While the common workflow is to post committed changes, some people have workflows where they want to post changes that are uncommitted, and have to resort to generating a diff manually and posting it using rbt post --diff-filename=.

This work would add an --uncommitted flag to rbt post that would generate diffs for uncommitted changes instead.

Approach:
Adding can_diff_committed capability to all clients, and let git set that to True to support it.
This revision simulate the behavior of svn, where we specify the tip to be --rbtools-working-copy so that git client know to remove the revision range out of the git commands.
In addition, to support this flag, --update, --diff-filename, and --guess-fields can't coexists, so the error is thrown when the user specifies those commands along with --uncommitted.
In order to view staged but uncommitted files, we need to add --cached to the git diff command.

Write an extra unit test to check that the git post --uncommitted works.
Verify that it throws error when --uncommitted and other options like --diff-filename,

  • 2
  • 105
  • 4
  • 111
Description From Last Updated
Add another blank line here. David Trowbridge David Trowbridge
This is useless (we just set result to be an empty dict above -- so there will never be a ... David Trowbridge David Trowbridge
Review Bot
Tran Nguyen
Tran Nguyen
Review Bot
Tran Nguyen
Review Bot
Tran Nguyen
Review Bot
David Trowbridge
Tran Nguyen
Review Bot
Tran Nguyen
Review Bot
Tran Nguyen
Review Bot
Tran Nguyen
Review Bot
David Trowbridge
Tran Nguyen
Review Bot
Tran Nguyen
Tran Nguyen
David Trowbridge
Tran Nguyen
Review Bot
Tran Nguyen
Review Bot
David Trowbridge
Tran Nguyen
Review Bot
Tran Nguyen
Review Bot
Christian Hammond
Tran Nguyen
Review Bot
Tran Nguyen
Review Bot
David Trowbridge
Tran Nguyen
Review Bot
David Trowbridge
Tran Nguyen
Review Bot
Barret Rennie
Tran Nguyen
Review Bot
Tran Nguyen
Tran Nguyen
Review Bot
Tran Nguyen
Review Bot
Christian Hammond
Tien Vu
Tran Nguyen
Review Bot
Tran Nguyen
Review Bot
Barret Rennie
Tran Nguyen
Review request changed

Commit:

-3860f9757e56c95feeceba83acff9f004c6f950c
+756835ef2152429dc74743f955cb274bf64e9b1a

Diff:

Revision 24 (+154 -20)

Show changes

Review Bot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/tests.py
        rbtools/commands/post.py
        rbtools/utils/review_request.py
        rbtools/clients/errors.py
        rbtools/clients/git.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/tests.py
        rbtools/commands/post.py
        rbtools/utils/review_request.py
        rbtools/clients/errors.py
        rbtools/clients/git.py
    
    
David Trowbridge
  1. 
      
  2. rbtools/clients/git.py (Diff revision 24)
     
     

    Add another blank line here.

  3. rbtools/clients/git.py (Diff revision 24)
     
     
     

    This is useless (we just set result to be an empty dict above -- so there will never be a commit_id in it).

Loading...