Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix --dry-run option incorrect behaviour #75

Merged
merged 1 commit into from
Oct 4, 2022
Merged

Fix --dry-run option incorrect behaviour #75

merged 1 commit into from
Oct 4, 2022

Conversation

uddmorningsun
Copy link
Contributor

# No setting upstream, so output command sequence should print origin
root@2ec8214d91c9:/tmp/cpython# git remote get-url upstream
error: No such remote 'upstream'
root@2ec8214d91c9:/tmp/cpython# cherry_picker --dry-run ab5b56ba6d 3.7
... ...
Dry run requested, listing expected command sequence
  dry-run: git remote get-url upstream
  dry-run: git fetch upstream --no-tags
Now backporting 'ab5b56ba6d' into '3.7'
  dry-run: git remote get-url upstream
  dry-run: git checkout -b backport-ab5b56b-3.7 upstream/3.7
  dry-run: git cherry-pick -x ab5b56ba6d

  dry-run: git show -s --format=%B ab5b56ba6d
Traceback (most recent call last):
... ...

  File "/usr/local/lib/python3.10/dist-packages/cherry_picker/cherry_picker.py", line 645, in cherry_pick_cli
    cherry_picker.backport()
  File "/usr/local/lib/python3.10/dist-packages/cherry_picker/cherry_picker.py", line 387, in backport
    commit_message = self.amend_commit_message(cherry_pick_branch)
  File "/usr/local/lib/python3.10/dist-packages/cherry_picker/cherry_picker.py", line 269, in amend_commit_message
    updated_commit_message = f"""{commit_prefix}{self.get_commit_message(self.commit_sha1)}
  File "/usr/local/lib/python3.10/dist-packages/cherry_picker/cherry_picker.py", line 211, in get_commit_message
    message = self.run_cmd(cmd).strip()
AttributeError: 'NoneType' object has no attribute 'strip'

Signed-off-by: Chenyang Yan memory.yancy@gmail.com

```
# No setting upstream, so output command sequence should print origin
root@2ec8214d91c9:/tmp/cpython# git remote get-url upstream
error: No such remote 'upstream'
```

```
root@2ec8214d91c9:/tmp/cpython# cherry_picker --dry-run ab5b56ba6d 3.7
... ...
Dry run requested, listing expected command sequence
  dry-run: git remote get-url upstream
  dry-run: git fetch upstream --no-tags
Now backporting 'ab5b56ba6d' into '3.7'
  dry-run: git remote get-url upstream
  dry-run: git checkout -b backport-ab5b56b-3.7 upstream/3.7
  dry-run: git cherry-pick -x ab5b56ba6d

  dry-run: git show -s --format=%B ab5b56ba6d
Traceback (most recent call last):
... ...

  File "/usr/local/lib/python3.10/dist-packages/cherry_picker/cherry_picker.py", line 645, in cherry_pick_cli
    cherry_picker.backport()
  File "/usr/local/lib/python3.10/dist-packages/cherry_picker/cherry_picker.py", line 387, in backport
    commit_message = self.amend_commit_message(cherry_pick_branch)
  File "/usr/local/lib/python3.10/dist-packages/cherry_picker/cherry_picker.py", line 269, in amend_commit_message
    updated_commit_message = f"""{commit_prefix}{self.get_commit_message(self.commit_sha1)}
  File "/usr/local/lib/python3.10/dist-packages/cherry_picker/cherry_picker.py", line 211, in get_commit_message
    message = self.run_cmd(cmd).strip()
AttributeError: 'NoneType' object has no attribute 'strip'
```

Signed-off-by: Chenyang Yan <memory.yancy@gmail.com>
@cpython-cla-bot
Copy link

cpython-cla-bot bot commented Sep 28, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@Mariatta Mariatta added the hacktoberfest-accepted Accepted for hacktoberfest label Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Accepted for hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants