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

Include file names in challenge_uncommited_changes() #2001

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

olivroy
Copy link
Contributor

@olivroy olivroy commented Jun 9, 2024

Proof of concept to make the message shorter, and more focused on current situation.

Adding a which argument that conflicts with msg.

Rephrase message to be shorter.

Add a link to the uncommited files with {.file. format_inline() will shorten automatically as needed.

I think it is worth adding files in the message, since it can facilitate the choice.

Let me know what you think!

This PR:

image

Before

image

  1. If I know which files are not commited, I spend more time figuring out if I should press 1, 2, or 3 for yes or no is than actually looking if I'm okay with continuing.
  2. If I don't know what files, I have to go look elsewhere to figure out which files are not commited, and then go to do step 1.

Yields the following message (instead of the correctly formatted with ! before.

    There are uncommitted changes and we're about to create and push to a new \
    GitHub repo 

@olivroy olivroy changed the title Challenge uncommited tweaks in message Tweak wording in challenge_uncommited_changes() Jun 9, 2024
@olivroy olivroy changed the title Tweak wording in challenge_uncommited_changes() Include file names in challenge_uncommited_changes() Jun 26, 2024
@jennybc
Copy link
Member

jennybc commented Jul 29, 2024

I think this is a good pattern to reuse in this scenario:

> usethis::use_dev_version(push = TRUE)
✔ Adding "3.0.0.9000" to Version.
✔ Adding new heading to NEWS.md.
ℹ There are 2 uncommitted files:
• DESCRIPTION
• NEWS.md
! Is it ok to commit and push them?
...

This is ultimately coming from git_ask_commit(). I suspect there might be some refactoring that would help to share this code in more situations.

@olivroy olivroy force-pushed the challenge-uncommited-tweaks branch from 87cd0e9 to 54e13c1 Compare August 15, 2024 21:14
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.

2 participants