Skip to content

fix(git-redate): fix settings path#29

Open
euberdeveloper wants to merge 1 commit into
PotatoLabs:masterfrom
euberdeveloper:patch-1
Open

fix(git-redate): fix settings path#29
euberdeveloper wants to merge 1 commit into
PotatoLabs:masterfrom
euberdeveloper:patch-1

Conversation

@euberdeveloper
Copy link
Copy Markdown

I noticed that in my pc (Ubuntu 20 - bash), using SETTINGS_FILE="~/.redate-settings"; does not work when tested with [ -f $SETTINGS_FILE ], while SETTINGS_FILE="$HOME/.redate-settings" does

I noticed that in my pc (Ubuntu 20 - bash), using `SETTINGS_FILE="~/.redate-settings";` does not work when tested with `[ -f $SETTINGS_FILE ]`, while `SETTINGS_FILE="$HOME/.redate-settings"` does
@lc-at
Copy link
Copy Markdown

lc-at commented Jan 4, 2022

I had the same issue a couple days ago. I just tested your patch and it works.

The tilde is extended by bash but not when it is wrapped in quotes (according to this). So, another workaround would be to remove the quotes: SETTINGS_FILE=~/.redate-settings; (using the quotes look nicer IMO).

SiteRelEnby added a commit to SiteRelEnby/git-redate that referenced this pull request May 8, 2026
- SETTINGS_FILE used a quoted ~ which never expanded, so the script
  would write a file literally named '~/.redate-settings' in CWD
  every time the editor prompt fell through. Use $HOME.
- mktemp was creating gitblah-XXXX in the working directory; switch
  to mktemp -t so it lands in $TMPDIR and can't be picked up by
  glob-happy git operations.
- echo "...\n" was printing literal backslash-n; convert to printf.
- Quote test variables and use single = so the editor-choice
  comparisons don't blow up on empty input.
- read -r so backslashes in editor paths survive.
- Add missing --no-show-signature on the n=5 fallback git log.

The $HOME fix was independently proposed in upstream PR PotatoLabs#29 and the
echo->printf fix in PR PotatoLabs#30; crediting those authors below.

Co-authored-by: euberdeveloper <33126163+euberdeveloper@users.noreply.github.com>
Co-authored-by: lc-at <30001379+lc-at@users.noreply.github.com>
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