-
Notifications
You must be signed in to change notification settings - Fork 7
Multiple author #155
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
Multiple author #155
Conversation
Updated the GitLog struct to replace the single author string with an array of authors. Modified argument building to handle multiple authors when generating git log commands. Additionally, updated the LogStore to reflect the changes in authors parsing.
…eferences in FolderView and related tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances search functionality by supporting multiple authors, refactors token handling for clarity, and updates tests and UI to match the new API.
- Introduce multi-author support in
GitLog
andLogStore
- Rename
SearchTokensHandler.handle
tonormalize
and consolidate token logic - Update tests and
FolderView
to use the newnormalize
method
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
GitClientTests/SearchTokensHandlerTests.swift | Updated tests to call normalize instead of handle |
GitClient/Views/Folder/FolderView.swift | Switched from handle to normalize in the search tokens update |
GitClient/Models/SearchTokensHandler.swift | Renamed handle → normalize and merged .author with .path case |
GitClient/Models/Observables/LogStore.swift | Changed single author property to authors array |
GitClient/Models/Commands/GitLog.swift | Replaced single --author flag with multiple --author args |
Comments suppressed due to low confidence (2)
GitClientTests/SearchTokensHandlerTests.swift:28
- Typo in test name:
Math
should beMatch
to reflect.grepAllMatch
.
@Test func handleGrepAllMath() async throws {
GitClientTests/SearchTokensHandlerTests.swift:103
- Typo in test name:
Auhor
should beAuthor
.
@Test func handleAuhorInEdit() async throws {
@@ -72,7 +63,7 @@ struct SearchTokensHandler { | |||
return true | |||
} | |||
} | |||
case .path: | |||
case .author, .path: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .author
case was merged with .path
and now always returns all tokens, which breaks the intended behavior of replacing old author tokens. Separate .author
into its own case and filter only the new author tokens.
case .author, .path: | |
case .author: | |
return newTokens.filter { token in | |
switch token.kind { | |
case .author: | |
return !oldTokens.contains(token) | |
default: | |
return true | |
} | |
} | |
case .path: |
Copilot uses AI. Check for mistakes.
https://git-scm.com/docs/git-log#Documentation/git-log.txt---authorltpatterngt
===========
This pull request introduces changes to support multiple authors in search filters, refactors the
SearchTokensHandler
for improved clarity, and updates related tests. The most significant changes include replacing single-author handling with multi-author support, renaming thehandle
method tonormalize
for better semantic alignment, and modifying tests to reflect these updates.Support for multiple authors:
GitLog.swift
to replace single-author handling (author
) with multi-author support (authors
) and adjusted the logic for constructing Git command arguments. [1] [2]LogStore.swift
to support multiple authors in search tokens by changingauthor
toauthors
. [1] [2]Refactoring for clarity:
handle
method inSearchTokensHandler.swift
tonormalize
for improved semantic clarity.author
tokens inSearchTokensHandler.swift
by removing redundant filtering and aligning behavior with other token types. [1] [2]Test updates:
SearchTokensHandlerTests.swift
to use the renamednormalize
method and to reflect the changes in token handling logic.UI integration:
FolderView.swift
to use the updatednormalize
method for handling search tokens, ensuring compatibility with the refactored logic.