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

rework last step in setup.bash #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wpyoga
Copy link
Contributor

@wpyoga wpyoga commented Feb 2, 2022

I'm proposing a few changes to the last step in setup.bash, with rationale:

  1. Ask user (developer) to force-push the local repo to the remote.

When I used this script, I had to scroll upwards to find this instruction (and the command to do it). Automating this step means that the developer won't miss it. Also, I think it's a good idea to push the local repo immediately after running the setup script, because the developer won't get confused if they edit the files / scripts later and git push fails.

  1. Don't automatically show the TODO items.

On my laptop at least, git grep does not restore the screen contents after the grep results are closed. Letting the user (developer) do this for themselves gives them a chance to read the instructions before it's pushed out of the visible screen space.

Please let me know if this is not the correct approach, thank you.

if [ "yes" != "$ok" ]; then
printf "Local repo not pushed.\n"
printf "Manually push to origin/%s with \`git push --force-with-lease\`\n" "$primary_branch"
printf "Then, find TODO items with \`git grep -n TODO\` and resolve them.\n"

Choose a reason for hiding this comment

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

I do like this approach (git using a pager by default is very annoying) but would -C 3 still be useful here for a bit of context? No idea why -P was ever the case though :P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should omit the context lines because:

  • the TODO items are mostly independent of each other
  • to resolve the TODO items, the developer would have to open the file(s) anyway
  • having the line numbers is enough for the developer to open a file and quickly jump to that line, and then get the context
  • adding 3+3 lines of context (+ 1 line for separator) fills up the screen pretty quickly, and this makes it more difficult to see all the TODO items as a list

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