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

Added Status Message for Amending #309

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sahansk2
Copy link
Contributor

@sahansk2 sahansk2 commented Aug 30, 2020

Fixes #264

Tested locally on skill 2-1


(base) sahan@sahan-GA-78LMT-USB3:test$ git gud status
Before:
Hash :  8bce9d1
Message :  Commit 2
File :  Present

After:
Hash :  10c914a
Message :  now i am become death, destroyer of worlds
File :  Missing

@sahansk2 sahansk2 marked this pull request as ready for review September 6, 2020 21:23
Copy link
Owner

@benthayer benthayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that adding branches would change the method signature.

To avoid a headache, we can implement that before merging, but if the headache of refactoring later is acceptable, this functionality is still useful and can be merged after the other issues are addressed

gitgud/skills/user_messages.py Outdated Show resolved Hide resolved
file_operator = operations.get_operator()
display_data = [
{"_name": "Before", "_commit": file_operator.repo.commit(before_ref)},
{"_name": "After", "_commit": file_operator.repo.commit(after_ref)}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, it might be worth it to do tuples or nested dictionaries. Using underscores is a bit weird here.

@@ -177,3 +177,26 @@ def display_entry(index, human_name, code_name, indent):
code_name=item.name,
indent=indent
)


def amending_message(before_ref, after_ref, show_hashes=True, show_files=True, show_refs=True): # noqa: E501
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method doesn't let you show the branches as shown in #257

@sahansk2
Copy link
Contributor Author

@benthayer The branch displaying support is actually from #310 -- I took the code from there and implemented it here, but now that I think of it, we would have different commits with the same "content". If you're okay with it, I can remove the branch-displaying code from these commits, work on everything else not including the branches, and then rebase on master when #310 is merged. What do you think?

@sahansk2 sahansk2 marked this pull request as draft September 11, 2020 23:06
@benthayer benthayer changed the base branch from master to main November 26, 2020 19:11
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

Successfully merging this pull request may close these issues.

Amending Status Message
2 participants