Skip to content

Add git information to PD context#7202

Merged
neonichu merged 3 commits into
mainfrom
add-git-info-to-context
Jan 11, 2024
Merged

Add git information to PD context#7202
neonichu merged 3 commits into
mainfrom
add-git-info-to-context

Conversation

@neonichu

Copy link
Copy Markdown
Contributor

This adds a few bits of information about a package's git repository to the context accessible to package manifests:

  • the current commit
  • the current tag (if any)
  • whether or not there are uncommited changes

rdar://111523616

This adds a few bits of information about a package's git repository to the context accessible to package manifests:
- the current commit
- the current tag (if any)
- whether or not there are uncommited changes

rdar://111523616
@neonichu neonichu self-assigned this Dec 14, 2023
@neonichu

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@neonichu

Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows

@neonichu neonichu requested a review from grynspan December 14, 2023 21:58
@neonichu

Copy link
Copy Markdown
Contributor Author

@grynspan added you since you asked for this kind of functionality in the context of swift-testing, so trying to make sure we can cover your use case as well

@neonichu

Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows

3 similar comments
@neonichu

Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows

@neonichu

Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows

@neonichu

Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows

Comment thread Tests/PackageLoadingTests/PD_5_11_LoadingTests.swift Outdated
@grynspan

grynspan commented Jan 3, 2024

Copy link
Copy Markdown
Contributor

This would definitely meet our needs and let us replace our GitStatus compiler plugin. Thanks!

Comment thread Sources/PackageDescription/Context.swift
Co-authored-by: Max Desiatov <m_desiatov@apple.com>
@neonichu

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@neonichu

Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows

2 similar comments
@neonichu

Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows

@neonichu

Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows

@neonichu neonichu merged commit cb04409 into main Jan 11, 2024
@neonichu neonichu deleted the add-git-info-to-context branch January 11, 2024 22:11
grynspan added a commit to swiftlang/swift-testing that referenced this pull request Jan 24, 2024
A recent PR on Swift Package Manager (swiftlang/swift-package-manager#7202) added a `gitInformation` property to the package manifest's `Context` global. This property contains exactly the information we need from the GitStatus plugin. Let's remove it, then!

Adopting the `gitInformation` property requires that we drop remaining support for Swift 5.10. We will continue to minimally support it in a separate Package.swift file (where we simply won't have git repo information at build time.) This PR does not strip out other 5.10 support code such as `XCTestScaffold`.

Resolves rdar://121529847.
grynspan added a commit to swiftlang/swift-testing that referenced this pull request Jan 25, 2024
A recent PR on Swift Package Manager (swiftlang/swift-package-manager#7202) added a `gitInformation` property to the package manifest's `Context` global. This property contains exactly the information we need from the GitStatus plugin. Let's remove it, then!

Adopting the `gitInformation` property requires that we drop remaining support for Swift 5.10. We will continue to minimally support it in a separate Package.swift file (where we simply won't have git repo information at build time.) This PR does not strip out other 5.10 support code such as `XCTestScaffold`.

Resolves rdar://121529847.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants