Skip to content

fix: add --no-pager option to git command#5888

Merged
TheOtterlord merged 3 commits intowithastro:mainfrom
CaptainOfPhB:patch-1
Dec 24, 2023
Merged

fix: add --no-pager option to git command#5888
TheOtterlord merged 3 commits intowithastro:mainfrom
CaptainOfPhB:patch-1

Conversation

@CaptainOfPhB
Copy link
Copy Markdown
Contributor

Description (required)

The previous git command can not work as expected. With no --no-pager option, git command will output the paging result, so execSync can't get the returned result.

image

After adding the --no-pager option(meanwhile set pretty to %cIand wrap filepath with double quote), we get what we want.

image

Related issues & labels (optional)

  • Suggested label: update doc

@vercel
Copy link
Copy Markdown

vercel bot commented Dec 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Dec 24, 2023 7:22pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
docs-i18n ⬜️ Ignored (Inspect) Visit Preview Dec 24, 2023 7:22pm

@sarah11918 sarah11918 added improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) help - confirm behaviour Walk through the example/issue and confirm this is a general behaviour, or a correct update to make. help wanted Issues looking for someone to run with them! labels Dec 23, 2023
Copy link
Copy Markdown
Member

@TheOtterlord TheOtterlord left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @CaptainOfPhB!

I see what you mean about the pager when using the command in the terminal. However, I found that calling execSync with the git command works without --no-pager, and only in the terminal did I have that issue.

Looking at the new formatting, running execSync with --pretty=%cI, it threw an invalid date error, displaying the last character as a \n, something that doesn't happen with the old argument. Did you have a specific issue with the old formatting?

@CaptainOfPhB
Copy link
Copy Markdown
Contributor Author

Thanks for the PR @CaptainOfPhB!

I see what you mean about the pager when using the command in the terminal. However, I found that calling execSync with the git command works without --no-pager, and only in the terminal did I have that issue.

Looking at the new formatting, running execSync with --pretty=%cI, it threw an invalid date error, displaying the last character as a \n, something that doesn't happen with the old argument. Did you have a specific issue with the old formatting?

Thank you for your reply!

The previous command run failed yesterday but worked just now when I tried again. Looks so wired :(

But the filepath should wrap with double quotes or the command will fail if there is blank space in the filename.

@sarah11918
Copy link
Copy Markdown
Member

Hi @CaptainOfPhB ! Would you please update your suggestion if you think all that's now needed are the double quotes? Then, we can get this merged! 🥳

@TheOtterlord TheOtterlord merged commit 0188968 into withastro:main Dec 24, 2023
@TheOtterlord
Copy link
Copy Markdown
Member

Thanks for the update! Let's get this merged! 🥳

yanthomasdev added a commit that referenced this pull request Jan 4, 2024
Update french translation with last PR #5766 and #5888

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
ematipico pushed a commit that referenced this pull request Jan 26, 2024
* fix: add `--no-pager` option to git command

* Update src/content/docs/en/recipes/modified-time.mdx

---------

Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
ematipico pushed a commit that referenced this pull request Jan 26, 2024
Update french translation with last PR #5766 and #5888

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help - confirm behaviour Walk through the example/issue and confirm this is a general behaviour, or a correct update to make. help wanted Issues looking for someone to run with them! improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants