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

Update instructions and test helpers for git-daemon #1684

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

EliahKagan
Copy link
Contributor

@EliahKagan EliahKagan commented Oct 1, 2023

On a current Cygwin system with git 2.39.0 (the latest version offered by the Cygwin package manager), git-daemon is present, with the Cygwin path /usr/libexec/git-core/git-daemon.exe. I believe this has been the case for a long time; as detailed below, Cygwin was not ever treated specially in the way that was assumed, yet no breakage resulted.

The cygwin-test.yml workflow does not take any special steps to allow git-daemon to work, but all tests have been passing in it even without skipping or xfailing tests that seem related to git-daemon.

The git_daemon_launched function in test/lib/helper.py invokes git-daemon directly (rather than through git daemon) only when is_win evaluates true. This only happens on native Windows systems, while Cygwin is treated the same as (other) Unix-like systems yet still works. So maybe Cygwin git-daemon was never a special case.

Whether or not it was, the message about git-daemon needing to be findable in a PATH search is also under an is_win check, and thus is never shown on Cygwin. So I've removed the Cygwin part of that message. (Because the path shown is a MinGW-style path, I have kept the wording about that being for MinGW-git, even though it is no longer needed to disambiguate the Cygwin case.)

The greatest value here is the simplification of the documentation and comments. But for consistency, and to make sure the code and comments don't disagree, I've removed the previous suppression of Cygwin special casing: now, Cygwin paths are allowed to be normalized using Cygwin path logic even when passed to git daemon as part of the tests. Both ways work on Cygwin in the tests actually being done.

The code change part of this PR only affects test code. Nothing in this pull request modifies anything in the git module.

On a current Cygwin system with git 2.39.0 (the latest version
offered by the Cygwin package manager), git-daemon is present, with
the Cygwin path /usr/libexec/git-core/git-daemon.exe.

In addition, the cygwin-test.yml workflow does not take any special
steps to allow git-daemon to work, but all tests pass in it even
without skipping or xfailing tests that seem related to git-daemon.

The git_daemon_launched function in test/lib/helper.py only invokes
git-daemon directly (rather than through "git daemon") when is_win
evaluates true, which only happens on native Windows systems, not
Cygwin, which is treated the same as (other) Unix-like systems and
still works. So maybe Cygwin git-daemon was never a special case.

Whether or not it was, the message about git-daemon needing to be
findable in a PATH search is also under an is_win check, and thus
is never shown on Cygwin. So I've removed the Cygwin part of that
message. (Because the path shown is a MinGW-style path, I have kept
the wording about that being for MinGW-git, even though it is no
longer needed to disambiguate the Cygwin case.)
Since the Cygwin git-daemon can be used.
@EliahKagan EliahKagan marked this pull request as ready for review October 1, 2023 21:55
@@ -217,12 +215,11 @@ def git_daemon_launched(base_path, ip, port):
)
if is_win:
msg += textwrap.dedent(
r"""
R"""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using a capital R here instead of r causes some editors to display the string as truly raw, rather than as a regular expression. black permits both case variants, even though they mean the same thing to all Python implementations, to allow for this expressiveness. I found this made the string much easier to read in VS Code. However, you may nonetheless prefer this not be done, or that it be deferred until it can be more consistently applied across the codebase. I certainly have no objection to putting this back to r.

Copy link
Member

Choose a reason for hiding this comment

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

That's a super-interesting feature and I wasn't aware! I think there is great value in having (at least some) editors display the string in a more readable fashion, so yes, please keep making these improvements.

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

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

That's a great catch, thanks so much!

I see how running on Windows natively gets closer with every PR ❤️.

@@ -217,12 +215,11 @@ def git_daemon_launched(base_path, ip, port):
)
if is_win:
msg += textwrap.dedent(
r"""
R"""
Copy link
Member

Choose a reason for hiding this comment

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

That's a super-interesting feature and I wasn't aware! I think there is great value in having (at least some) editors display the string in a more readable fashion, so yes, please keep making these improvements.

@Byron Byron merged commit f9a3b83 into gitpython-developers:main Oct 2, 2023
8 checks passed
@EliahKagan EliahKagan deleted the daemon branch October 2, 2023 08:21
renovate bot referenced this pull request in allenporter/flux-local Oct 20, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [GitPython](https://github.com/gitpython-developers/GitPython) |
`==3.1.37` -> `==3.1.40` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/GitPython/3.1.40?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/GitPython/3.1.40?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/GitPython/3.1.37/3.1.40?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/GitPython/3.1.37/3.1.40?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>gitpython-developers/GitPython (GitPython)</summary>

###
[`v3.1.40`](https://github.com/gitpython-developers/GitPython/compare/3.1.38...3.1.40)

[Compare
Source](https://github.com/gitpython-developers/GitPython/compare/3.1.38...3.1.40)

###
[`v3.1.38`](https://github.com/gitpython-developers/GitPython/releases/tag/3.1.38)

[Compare
Source](https://github.com/gitpython-developers/GitPython/compare/3.1.37...3.1.38)

#### What's Changed

- Add missing assert keywords by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1678](https://github.com/gitpython-developers/GitPython/pull/1678)
- Make clear every test's status in every CI run by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1679](https://github.com/gitpython-developers/GitPython/pull/1679)
- Fix new link to license in readme by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1680](https://github.com/gitpython-developers/GitPython/pull/1680)
- Drop unneeded flake8 suppressions by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1681](https://github.com/gitpython-developers/GitPython/pull/1681)
- Update instructions and test helpers for git-daemon by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1684](https://github.com/gitpython-developers/GitPython/pull/1684)
- Fix Git.execute shell use and reporting bugs by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1687](https://github.com/gitpython-developers/GitPython/pull/1687)
- No longer allow CI to select a prerelease for 3.12 by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1689](https://github.com/gitpython-developers/GitPython/pull/1689)
- Clarify Git.execute and Popen arguments by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1688](https://github.com/gitpython-developers/GitPython/pull/1688)
- Ask git where its daemon is and use that by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1697](https://github.com/gitpython-developers/GitPython/pull/1697)
- Fix bugs affecting exception wrapping in rmtree callback by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1700](https://github.com/gitpython-developers/GitPython/pull/1700)
- Fix dynamically-set **all** variable by
[@&#8203;DeflateAwning](https://github.com/DeflateAwning) in
[https://github.com/gitpython-developers/GitPython/pull/1659](https://github.com/gitpython-developers/GitPython/pull/1659)
- Fix small
[#&#8203;1662](https://github.com/gitpython-developers/GitPython/issues/1662)
regression due to
[#&#8203;1659](https://github.com/gitpython-developers/GitPython/issues/1659)
by [@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1701](https://github.com/gitpython-developers/GitPython/pull/1701)
- Drop obsolete info on yanking from security policy by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1703](https://github.com/gitpython-developers/GitPython/pull/1703)
- Have Dependabot offer submodule updates by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1702](https://github.com/gitpython-developers/GitPython/pull/1702)
- Bump git/ext/gitdb from `49c3178` to `8ec2390` by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/gitpython-developers/GitPython/pull/1704](https://github.com/gitpython-developers/GitPython/pull/1704)
- Bump git/ext/gitdb from `8ec2390` to `6a22706` by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/gitpython-developers/GitPython/pull/1705](https://github.com/gitpython-developers/GitPython/pull/1705)
- Update readme for milestone-less releasing by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1707](https://github.com/gitpython-developers/GitPython/pull/1707)
- Run Cygwin CI workflow commands in login shells by
[@&#8203;EliahKagan](https://github.com/EliahKagan) in
[https://github.com/gitpython-developers/GitPython/pull/1709](https://github.com/gitpython-developers/GitPython/pull/1709)

#### New Contributors

- [@&#8203;DeflateAwning](https://github.com/DeflateAwning) made their
first contribution in
[https://github.com/gitpython-developers/GitPython/pull/1659](https://github.com/gitpython-developers/GitPython/pull/1659)

**Full Changelog**:
gitpython-developers/GitPython@3.1.37...3.1.38

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/allenporter/flux-local).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xOS4yIiwidXBkYXRlZEluVmVyIjoiMzcuMTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
EliahKagan added a commit to EliahKagan/GitPython that referenced this pull request Oct 24, 2023
This removes the Windows-specific information in the warning
message in git_daemon_launched.

After the associated functionality was updated in gitpython-developers#1684 and the
warning message was abridged accordingly, the functionality was
updated again in gitpython-developers#1697, causing the message to be outdated and no
longer helpeful (since having git-daemon.exe in a PATH directory is
no longer necessary or useful), without any corresponding change to
the message.
EliahKagan added a commit to EliahKagan/GitPython that referenced this pull request Oct 24, 2023
This removes the Windows-specific information in the warning
message in git_daemon_launched.

After the associated functionality was updated in gitpython-developers#1684 and the
warning message was abridged accordingly, the functionality was
updated again in gitpython-developers#1697, causing the message to be outdated and no
longer helpeful (since having git-daemon.exe in a PATH directory is
no longer necessary or useful), without any corresponding change to
the message.
EliahKagan added a commit to EliahKagan/GitPython that referenced this pull request Oct 24, 2023
This removes the Windows-specific information in the warning
message in git_daemon_launched.

After the associated functionality was updated in gitpython-developers#1684 and the
warning message was abridged accordingly, the functionality was
updated again in gitpython-developers#1697, causing the message to be outdated and no
longer helpeful (since having git-daemon.exe in a PATH directory is
no longer necessary or useful), without any corresponding change to
the message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants