Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deprecate default of Git.show(strip_newline_in_stdout=False)#1948

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
SonOfLilit wants to merge3 commits intogitpython-developers:main
base:main
Choose a base branch
Loading
fromSonOfLilit:main

Conversation

SonOfLilit
Copy link

As per our discussion in#1377.

Also fix a few tests that were broken by my git being configured to create new repos withmain as the initial branch, so that all my tests pass.

Copy link
Member

@ByronByron left a comment

Choose a reason for hiding this comment

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

Thanks a lot for contributing.

I think with a few minor modifications this PR can be merged.

@@ -1210,6 +1210,14 @@ def execute(
if self.GIT_PYTHON_TRACE and (self.GIT_PYTHON_TRACE != "full" or as_process):
_logger.info(" ".join(redacted_command))

if strip_newline_in_stdout and command[:2] == ["git", "show"]:
Copy link
Member

Choose a reason for hiding this comment

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

"git" shouldn't be hard-coded, and I am pretty sure there is a variable for this somewhere.

@@ -1210,6 +1210,14 @@ def execute(
if self.GIT_PYTHON_TRACE and (self.GIT_PYTHON_TRACE != "full" or as_process):
_logger.info(" ".join(redacted_command))

if strip_newline_in_stdout and command[:2] == ["git", "show"]:
warnings.warn(
"Git.show() has strip_newline_in_stdout=True by default, which probably isn't what you want and will "
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Git.show() has strip_newline_in_stdout=True by default, which probably isn't what you want andwill "
"Git.show() has strip_newline_in_stdout=True by default, which probably isn't what you want andmay "

return r

@with_rw_directory
def test_warn_when_strip_newline_in_stdout(self, rw_dir):
Copy link
Member

Choose a reason for hiding this comment

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

Let's put the additional assertion done intest_do_not_strip_newline_in_stdout here so that it's clearer what's under test: The deprecation warning ifgit show is used andstrip_newline_in_stdout=True. This way,test_do_not_strip_newline_in_stdout can be removed. I'd also hope that the assertion then can be changed to use the default value forstrip_newline_in_stdout, which is probablyTrue, the cause of the confusion in this case.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ByronByronByron requested changes

Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@SonOfLilit@Byron

[8]ページ先頭

©2009-2025 Movatter.jp