Git Product home page Git Product logo

pwcli's People

Contributors

jmberg avatar kvalo avatar tohojo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pwcli's Issues

Write README

Write a proper README for the project. At least an overview, "screenshot" and how to use it. Also development tips would be nice.

Sending automatic emails should be opt-in

If users try out pwcli it can now send emails without the user knowing it. To avoid that we should make emails opt-in by having it as configurable in the config file.

add a refresh command

Sometimes the list of patches in patchwork may change while the pwcli session is open (e.g. a new patch was submitted or the state of a patch changed). We may then want to refresh the list of patches without quitting and restarting pwcli. A "refresh" command could address that.

If stg import fails still compile script is run

Compile script should not be run if stg import fails:

Retrieving patches (1/1)
      [2/3] ath10k: use size_t for len variables                   2017-02-02 Amadeusz Sła New
------------------------------------------------------------
Apply 1 patches to the pending branch? [Apply/Skip/aBort] a
Failed to apply patch: ['stg', 'import', '--mbox', '--sign'] failed: 2
error: patch failed: drivers/net/wireless/ath/ath10k/debug.c:726
error: drivers/net/wireless/ath/ath10k/debug.c: patch does not apply
stg import: Diff does not apply cleanly

Build successful                                                 
Changes requested/Rejected/New/Deferred/Superseded/aWaiting upstream/not aPplicable/rFc/aBort? 

Support conflict resolution when committing

If one of the patches in the series of patches being committed fails to apply (e.g. due to a conflict), the whole command is aborted.

It would be nice to have the chance to start a shell and resolve the conflict manually before proceeding. In my flows, this usually happens when there is a conflict between -fixes and -next.

Notify about three way merge in the summary email

In the summary email it would be nice to notify if git had to fall back to 3-way merge, like here:

master@wireless-drivers-next > commit 2
Retrieving patches (1/1) 
9007981 mwifiex: Drop unnecessary include pcieport_if.h
------------------------------------------------------------
1 patches
commit All/commit Individually/aBort? a
Applying: mwifiex: Drop unnecessary include pcieport_if.h
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging drivers/net/wireless/marvell/mwifiex/pcie.h
============================================================
1 patches applied:

30cfe9f61c2e mwifiex: Drop unnecessary include pcieport_if.h

Accept/request Changes/Reject/Show mail/Edit mail/aBort? 

reply command doesn't support server patch ids

master@wireless-drivers-next > reply #12220245
Failed to convert index to integer: invalid literal for int() with base 10: '#12220245'

But show command works:

master@wireless-drivers-next > show #12220245
Delegate: kvalo
State: Changes Requested
From: Dan Carpenter <[email protected]>
Date: 2021-04-23 11:46:34
Patchwork-Id: 12220245

stg: filter out existing Patchwork-Id from patch before import

If a patch already has a Patchwork-Id (for example I have done that multiple times when picking patches from the pending branch and resubmitting them) pwcli adds a second one in the bottom:

Signed-off-by: Alice <[email protected]>
Patchwork-Id: 1111
Signed-off-by: Bob <[email protected]>
Patchwork-Id: 2222

But when pwcli reads the id from pending branch it uses the first id, which is the incorrect one.

One possible solution is to remove all lines which we start with "Patchwork-Id:". Another possibility is to reject the patch. Don't know what's the best.

Try to replicate the original Subject and use it in email

Patchwork removes "[PATCH]" (and varitions of it) from the Subject and doesn't provide the original Subject via XML-RPC interface. Using modified Subject makes the threading look ugly in the summary emails so try to replicate back the original Subject. Should be possible by investigation how patchwork strips the Subject.

Hardcode git output format

Luca reported that commit fails for him. It was because he is using git's decorate feature. A quick workaround was to remove $ from this regexp:

    match = re.search(r'^commit ([0-9a-f]{40})$', text, re.MULTILINE)

A proper fix would be to use hardocoded output format, like --pretty=format:%H or something similar. And maybe --no-decorate?

patch index with invalid values crashes

master@wireless-drivers-next > review 9
Retrieving patches (1/1)
      [2/2] mwifiex: ignore calibration data failure               2016-10-21 Amitkumar Ka Deferred
------------------------------------------------------------
Under review/Changes requested/Rejected/New/Deferred/Superseded/aWaiting upstream/not aPplicable/rFc/aBort? u
Patch set to Under Review
master@wireless-drivers-next > review 8,10
Traceback (most recent call last):
  File "/home/kvalo/bin/pwcli", line 2095, in <module>
    main()
  File "/home/kvalo/bin/pwcli", line 2092, in main
    pwcli.run_shell()
  File "/home/kvalo/bin/pwcli", line 1883, in run_shell
    args.func(args)
  File "/home/kvalo/bin/pwcli", line 1545, in cmd_review
    patches = self.get_patches_from_ids(args.ids)
  File "/home/kvalo/bin/pwcli", line 864, in get_patches_from_ids
    indexes = parse_list(ids)
  File "/home/kvalo/bin/pwcli", line 123, in parse_list
    start = int(start_str)
ValueError: invalid literal for int() with base 10: '8,10'

handle xmlrpclib.Fault exceptions nicely

2 patches applied:

31e41e6748ba rt2x00usb: do not anchor rx and tx urb's
2e0df2442185 rt2x00usb: fix anchor initialization

Accepted/Under review/Changes requested/Rejected/New/Deferred/Superseded/aWaiting upstream/not aPplicable/rFc/aBort? a
Traceback (most recent call last):
  File "/home/kvalo/bin/pwcli", line 2220, in <module>
    main()
  File "/home/kvalo/bin/pwcli", line 2217, in main
    pwcli.run_shell()
  File "/home/kvalo/bin/pwcli", line 2002, in run_shell
    args.func(args)
  File "/home/kvalo/bin/pwcli", line 1563, in cmd_commit
    patch.set_state_name(state)
  File "/home/kvalo/bin/pwcli", line 521, in set_state_name
    self.pw.rpc.patch_set(self.get_id(), params)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1283, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1316, in single_request
    return self.parse_response(response)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1493, in parse_response
    return u.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 800, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: "<class 'django.db.utils.OperationalError'>:(1040, 'Too many connections')">

SMTP debug logs

When dealing with SMTP problems it would be nice to see SMTP debug logs. server.set_debuglevel(2) enables and prints the debug log to stderr. Maybe add a switch --debug-smtp to enable that?

If the patch fails to compile, the commit is not removed from the repo

If the patch fails to compile and I choose the state Changes Requested, the patch is still in the repo. pwcli should automatically remove the applied commits from the patchset.

Thinking further, I think pwcli should remove the commits if any other state than Accepted is chosen.

Crash if list command returns empty set of patches

If there are no patches available pwcli crashes:

test-branch@pwcli-stub-Ta651k > 
potku:~/personal/patchwork/src/pwcli$ ./run_stub 
Connecting to http://localhost:8106/
User          : test (7477, 30052, 118371)
Projects      : stub-test
Tree          : pwcli-stub-Hsbz4D
Branch        : test-branch
New           : 18
Review        : 7
Upstream      : 0
Deferred      : 5
Total         : 30
test-branch@pwcli-stub-Hsbz4D > list -n doesnotexist

test-branch@pwcli-stub-Hsbz4D > review 2
Traceback (most recent call last):
  File "/home/kvalo/projects/personal/patchwork/src/pwcli/pwcli", line 2217, in <module>
    main()
  File "/home/kvalo/projects/personal/patchwork/src/pwcli/pwcli", line 2214, in main
    pwcli.run_shell()
  File "/home/kvalo/projects/personal/patchwork/src/pwcli/pwcli", line 2002, in run_shell
    args.func(args)
  File "/home/kvalo/projects/personal/patchwork/src/pwcli/pwcli", line 1664, in cmd_review
    patches = self.get_patches_from_ids(args.ids)
  File "/home/kvalo/projects/personal/patchwork/src/pwcli/pwcli", line 958, in get_patches_from_ids
    raise Exception('No patches available, doing nothing.')
Exception: No patches available, doing nothing.

Open patchwork patch page in the browser

It would be nice to be able to read all comments from patchwork before applying the patch. So pwcli could automatically open the patch page on the browser, for example like this:

$BROWSER https://patchwork.kernel.org/patch/9113281/

If $BROWSER is unset xdg-open would be a good default.

Commands where the page(s) could be opened:

  • commit patch list
  • review patch list
  • show command
  • others?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.