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

stg squash fails #157

Closed
rgrinberg opened this issue Oct 7, 2021 · 2 comments
Closed

stg squash fails #157

rgrinberg opened this issue Oct 7, 2021 · 2 comments

Comments

@rgrinberg
Copy link

The following triggered the crash:

[2] rgrinberg@rgrinberg-16> stg squash $(stg top) vendor-ocaml-integers
Error: Unhandled exception:
Traceback (most recent call last):
  File "/nix/store/phnwgjfmnyg8ij0s6n7wn41bxryf6k52-stgit-1.3/lib/python3.9/site-packages/stgit/main.py",
line 174, in _main
    ret = command.func(parser, options, args)
  File "/nix/store/phnwgjfmnyg8ij0s6n7wn41bxryf6k52-stgit-1.3/lib/python3.9/site-packages/stgit/commands/s
quash.py", line 176, in func
    retval, _ = squash(
  File "/nix/store/phnwgjfmnyg8ij0s6n7wn41bxryf6k52-stgit-1.3/lib/python3.9/site-packages/stgit/commands/s
quash.py", line 139, in squash
    new_patch_name = get_name(new_commit_data)
  File "/nix/store/phnwgjfmnyg8ij0s6n7wn41bxryf6k52-stgit-1.3/lib/python3.9/site-packages/stgit/commands/s
quash.py", line 122, in get_name
    return name or stack.patches.make_name(cd.message_str, allow=patches)
AttributeError: 'NoneType' object has no attribute 'message_str'

Let me know if you need more information.

Version information:

Stacked Git 1.3
git version 2.33.0
Python version 3.9.6 (default, Sep 18 2021, 15:13:38)
[Clang 7.1.0 (tags/RELEASE_710/final)]
@jpgrayson
Copy link
Collaborator

Thank you for this issue report, @rgrinberg. I am able to reproduce the issue and am working on a repair.

In the meantime, a workaround is to specify a name for the squashed patch on the command line with -n/--name. E.g.:

stg squash -n squashed $(stg top) other-patch

jpgrayson added a commit that referenced this issue Oct 8, 2021
Attempting to squash two patches out of order without also specifying a
name on the command line would cause new_commit_data to be None which
would then trigger an exception when trying to derive the new patch name
from the non-existent commit data.

The issue is resolved by making _squash_patches() responsible for
determining the new squashed patch name since it possesses the necessary
commit data at the appropriate moment.

Repairs #157.

Signed-off-by: Peter Grayson <pete@jpgrayson.net>
@rgrinberg
Copy link
Author

rgrinberg commented Oct 8, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants