Extract coauthors package from main mob.go#479
Merged
Conversation
Erweitert den bisherigen kurzen Ausblick (Sektion 6) zu einem vollstaendigen Plan mit Analyse der Funktionen und Abhaengigkeiten, konkreten Schritten (2.1-2.7), Signatur-Aenderungen, Teststrategie und Risikobewertung - analog zum bestehenden findnext/-Plan. https://claude.ai/code/session_01L7s8YbrDAfSPJu47wmcM3w
Move co-author tracking logic (AppendCoauthorsToSquashMsg, CollectCoauthorsFromWipCommits, CreateCommitMessage and helper functions) into a dedicated coauthors/ package. The gitUserEmail() dependency is now injected as a parameter instead of called internally. Unit tests moved to coauthors/coauthors_test.go, integration test TestStartDoneCoAuthors remains in root package. https://claude.ai/code/session_01L7s8YbrDAfSPJu47wmcM3w
Only AppendCoauthorsToSquashMsg needs to be exported since it's the only function called from outside the package. collectCoauthorsFromWipCommits and createCommitMessage are now unexported. https://claude.ai/code/session_01L7s8YbrDAfSPJu47wmcM3w
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extracts the coauthors functionality into a dedicated
coauthors/package, following the same pattern established by the earlierfindnext/package extraction. This is the second step in the planned package restructuring.Key Changes
coauthors/package withcoauthors.gocontaining all coauthor-related logicCollectCoauthorsFromWipCommits()- parses and processes coauthors from SQUASH_MSGAppendCoauthorsToSquashMsg()- orchestrates reading and appending coauthors to commit messageCreateCommitMessage()- formats coauthors as commit message trailercurrentUserEmailparameter toCollectCoauthorsFromWipCommits()andAppendCoauthorsToSquashMsg()instead of callinggitUserEmail()internally, eliminating external dependenciesTestCreateCommitMessage,TestSortByLength,TestRemoveDuplicateValues) tocoauthors/coauthors_test.goTestStartDoneCoAuthorsin rootcoauthors_test.gosince it tests the full session workflowmob.goto import and call the new package functions with the required email parameterImplementation Details
parseCoauthors,stripToAuthor,sortByLength,removeElementsContaining,removeDuplicateValues) remain unexported within the packageAuthortype alias is now exported from the packagedone()function, straightforward parameter passinghttps://claude.ai/code/session_01L7s8YbrDAfSPJu47wmcM3w