-
Notifications
You must be signed in to change notification settings - Fork 0
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
Consolidate branch merging into Branch
objects to maintain consistent unmerged
status information
#1028
Merged
Conversation
This file contains 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
…n listenerMiddleware
…ts in worktreeStatus command
…n updateVersionedMetafile command
…eeStatus entries in fileStatus command
…dded or cardUpdated actions
… for fileStatus command
…le 'revertChanges' async thunk for metafiles
…tenerMiddleware already handles filebased and versioned updates
…thunk in ResetButton
…n status on hover of FileComponent in Explorer cards
…epo, Status, and Branch fields
…mpact FSCache subscriptions
…tion and response callsites
…asedMetafile since conflict metafiles might not be populated with a content field
…nents containing textual content
…onedMetafile since worktreeStatus is capable of detecting unmerged status
…or (??) from TS 3.7
… in a typesafe manner
… base of an in-progress merge
…t status (Branch objects handle merging now)
…flicted metafile count
…nstead of modified status
…e attempting to read
…lly check branch status
nelsonni
added a commit
that referenced
this pull request
Dec 7, 2022
…nt `unmerged` status information (#1028) * Generalize listening for all (instead of selected) rejected actions in listenerMiddleware * Fixes for regex patterns to handle branch comparisons and entry formats in worktreeStatus command * Throw console.error if file-only FSCache observes an unlinkDir event * FSCache updates to track card UUIDs in 'reserved' instead of metafile UUIDs * Update status of all modified sub-files when calling worktreeStatus in updateVersionedMetafile command * Remove unnecessary imports * Rebuild yarn.lock * Resolve absolute paths based on repository root when filtering worktreeStatus entries in fileStatus command * Observe updated metafile for each update step when listening to cardAdded or cardUpdated actions * Translate 'uncommitted' branch status into '*modified' on directories for fileStatus command * Combine 'revertStagedChanges' and 'revertUnmergedChanges' into a single 'revertChanges' async thunk for metafiles * Fix newline parsing error in JSDoc block comments * Convert namespace import to named imports for slices/metafiles * Remove useEffect for hydrating child metafiles in Directory since listenerMiddleware already handles filebased and versioned updates * Reset all unstaged, staged, and unmerged files using 'revertChanges' thunk in ResetButton * Expand StyledTreeComponent to include a onHoverText for adding version status on hover of FileComponent in Explorer cards * Filter by git status instead of conflicts array in selectByConflicted selector * ConflictManagerReverse component for displaying UUID, Path, Update, Repo, Status, and Branch fields * Updated listenerMiddleware for card additions/updates/removals that impact FSCache subscriptions * Log action.meta fields in rejected async thunk actions observed by listenerMiddleware * Populate branch field to align ConflictManager metafile types at creation and response callsites * Filter conflicting metafiles by handler type instead of using isFilebasedMetafile since conflict metafiles might not be populated with a content field * Metafile 'loading' field renamed to 'flags' and extracted into Flag type * Transition to using the nullish coalescing operator (??) from TS 3.7 * GitStatus filters for staged/unstaged/conflicted consolidated into utils * Branch motif colors expanded to indicate branches with merge conflicts * Check branch status in updateBranch thunk * Badge component to display number of conflicting chunks in Card components containing textual content * Remove redundant check for unmerged conflict metafiles in updateVersionedMetafile since worktreeStatus is capable of detecting unmerged status * Update metafile with new code content using nullish coalescing operator (??) from TS 3.7 * Remove redundant updateBranch call during merge since updateBranches now calls updateBranch internally * Rename utils.isConflicted to isUnmerged to indicate that unmerged status differs from containing conflicting chunks * Await updateBranches immediately upon Refresh button click event * Extract regex patterns for conflicting chunks into utils.getConflictingChunks * Check for conflicting chunks when determining if conflicted motif should be returned in getSourceMotif since status can change while chunks remain in content * JSDoc @returns type for flattenArray and flattenObject * symmetrical fn for partitioning two arrays into symmetrical differences and intersection subarrays * updateVersionedMetafile thunk updates descendants for directory parameter metafiles * selectByConflicted selector expanded to differentiate metafiles based on branches * JSDoc @returns type for diff * JSDoc @returns type for useMap * JSDoc @returns type for usePrevious * Newline after description in JSDoc block * JSDoc @returns types and newlines after description blocks for immutables fns * Newline after description in JSDoc blocks and adhering to jsdoc/multiline-blocks rule * JSDoc @param and @returns types for createState and mockStore * JSDoc comments clarified to indicate listeners that match on async thunk actions * Fix listener updates for fulfilled Metafile async thunk update actions to use updated versions of underlying metafile * Rename isUnstaged() to isModified() to more accurately reflect a modified, but not staged status * Update conflicts field during onChange event in Editor * Remove unused import withStyles * All Button components updated to prevent propogating click events to parent components * Refresh button component for updating filebased and versioned metafile fields * BranchRibbon component responds to conflicts by changing text and background colors * Add `electron-devtools-installer` package to devDependencies to auto install DevTool extensions into Electron * Enable `redux-devtools` module in Electron app * Remove unused module.exports.fallback imports * Remove `plugin:import/electron` and use`settings.import/modules: ["electron"]` instead * Standardized quotes in jest.config.js moduleNameMapper * Updated ARCHITECTURE for changes to import packages and TS/ESLint/Jest/RTL configs * ConflictManager card component removed, conflicts managed directly in Explorer card component * Add `enabled` prop for enabling/disabling Button components during render * Remove listener checks for deprecated `ConflictManager` metafile types * Allow multiple astericks in JSDoc comments for Markdown bullet lists * Fix overflowing card-header when title is long * New Metadata component for a standardized table view of Metafile contents on the back of cards * BranchList component simplified and migrated into Branches component tree * BranchRibbon component simplified and migrated into Branches component tree * JSDoc comments for Branches component * BranchItem component allows highlights for indicating the current branch of a parent card, metafile, or list * BranchesView button component for selecting Branches view on the back of cards * Migrating Card components to use Metadata component on reverse * Editor code content switched to pass-through from Metafile content property * Updated ref to BranchRibbon component * Updated jsdoc/no-multi-astericks rule format * removeObjectProperty function added for immutably removing properties in a typesafe manner * worktreeStatus checks for in-progress merges and returns 'unmerged' if found * Branch objects expanded to include merging field when a branch is the base of an in-progress merge * Metafile object no longer differentiates merging status, only conflict status (Branch objects handle merging now) * BranchRibbon indicates unmerged based on branch.status instead of conflicted metafile count * Abort button enable via checks against merging branches instead of merging metafiles * Resolve button simplified to key off of merging branches in Explorer metafiles * Stage button checks for unstaged metafiles based on unmerged status instead of modified status * Remove unused isAbortable import * Metadata component checks for merging branches instead of merging metafiles * MergeDialog modal component checks for merging branches and updates accordingly * fetchMergingBranches checks for the existence of MERGE_MSG file before attempting to read * Remove unused SHA1 type import * Always enable Redux DevTools integration * Mock git-status for all fetchBranch tests that intrinsically check branch status * Mock git-status for all updateVersionedMetafile tests that intrinsically check branch status * Partial removal of strict RootState typing on useAppSelector usage
nelsonni
added a commit
that referenced
this pull request
Dec 7, 2022
…nt `unmerged` status information (#1028) * Generalize listening for all (instead of selected) rejected actions in listenerMiddleware * Fixes for regex patterns to handle branch comparisons and entry formats in worktreeStatus command * Throw console.error if file-only FSCache observes an unlinkDir event * FSCache updates to track card UUIDs in 'reserved' instead of metafile UUIDs * Update status of all modified sub-files when calling worktreeStatus in updateVersionedMetafile command * Remove unnecessary imports * Rebuild yarn.lock * Resolve absolute paths based on repository root when filtering worktreeStatus entries in fileStatus command * Observe updated metafile for each update step when listening to cardAdded or cardUpdated actions * Translate 'uncommitted' branch status into '*modified' on directories for fileStatus command * Combine 'revertStagedChanges' and 'revertUnmergedChanges' into a single 'revertChanges' async thunk for metafiles * Fix newline parsing error in JSDoc block comments * Convert namespace import to named imports for slices/metafiles * Remove useEffect for hydrating child metafiles in Directory since listenerMiddleware already handles filebased and versioned updates * Reset all unstaged, staged, and unmerged files using 'revertChanges' thunk in ResetButton * Expand StyledTreeComponent to include a onHoverText for adding version status on hover of FileComponent in Explorer cards * Filter by git status instead of conflicts array in selectByConflicted selector * ConflictManagerReverse component for displaying UUID, Path, Update, Repo, Status, and Branch fields * Updated listenerMiddleware for card additions/updates/removals that impact FSCache subscriptions * Log action.meta fields in rejected async thunk actions observed by listenerMiddleware * Populate branch field to align ConflictManager metafile types at creation and response callsites * Filter conflicting metafiles by handler type instead of using isFilebasedMetafile since conflict metafiles might not be populated with a content field * Metafile 'loading' field renamed to 'flags' and extracted into Flag type * Transition to using the nullish coalescing operator (??) from TS 3.7 * GitStatus filters for staged/unstaged/conflicted consolidated into utils * Branch motif colors expanded to indicate branches with merge conflicts * Check branch status in updateBranch thunk * Badge component to display number of conflicting chunks in Card components containing textual content * Remove redundant check for unmerged conflict metafiles in updateVersionedMetafile since worktreeStatus is capable of detecting unmerged status * Update metafile with new code content using nullish coalescing operator (??) from TS 3.7 * Remove redundant updateBranch call during merge since updateBranches now calls updateBranch internally * Rename utils.isConflicted to isUnmerged to indicate that unmerged status differs from containing conflicting chunks * Await updateBranches immediately upon Refresh button click event * Extract regex patterns for conflicting chunks into utils.getConflictingChunks * Check for conflicting chunks when determining if conflicted motif should be returned in getSourceMotif since status can change while chunks remain in content * JSDoc @returns type for flattenArray and flattenObject * symmetrical fn for partitioning two arrays into symmetrical differences and intersection subarrays * updateVersionedMetafile thunk updates descendants for directory parameter metafiles * selectByConflicted selector expanded to differentiate metafiles based on branches * JSDoc @returns type for diff * JSDoc @returns type for useMap * JSDoc @returns type for usePrevious * Newline after description in JSDoc block * JSDoc @returns types and newlines after description blocks for immutables fns * Newline after description in JSDoc blocks and adhering to jsdoc/multiline-blocks rule * JSDoc @param and @returns types for createState and mockStore * JSDoc comments clarified to indicate listeners that match on async thunk actions * Fix listener updates for fulfilled Metafile async thunk update actions to use updated versions of underlying metafile * Rename isUnstaged() to isModified() to more accurately reflect a modified, but not staged status * Update conflicts field during onChange event in Editor * Remove unused import withStyles * All Button components updated to prevent propogating click events to parent components * Refresh button component for updating filebased and versioned metafile fields * BranchRibbon component responds to conflicts by changing text and background colors * Add `electron-devtools-installer` package to devDependencies to auto install DevTool extensions into Electron * Enable `redux-devtools` module in Electron app * Remove unused module.exports.fallback imports * Remove `plugin:import/electron` and use`settings.import/modules: ["electron"]` instead * Standardized quotes in jest.config.js moduleNameMapper * Updated ARCHITECTURE for changes to import packages and TS/ESLint/Jest/RTL configs * ConflictManager card component removed, conflicts managed directly in Explorer card component * Add `enabled` prop for enabling/disabling Button components during render * Remove listener checks for deprecated `ConflictManager` metafile types * Allow multiple astericks in JSDoc comments for Markdown bullet lists * Fix overflowing card-header when title is long * New Metadata component for a standardized table view of Metafile contents on the back of cards * BranchList component simplified and migrated into Branches component tree * BranchRibbon component simplified and migrated into Branches component tree * JSDoc comments for Branches component * BranchItem component allows highlights for indicating the current branch of a parent card, metafile, or list * BranchesView button component for selecting Branches view on the back of cards * Migrating Card components to use Metadata component on reverse * Editor code content switched to pass-through from Metafile content property * Updated ref to BranchRibbon component * Updated jsdoc/no-multi-astericks rule format * removeObjectProperty function added for immutably removing properties in a typesafe manner * worktreeStatus checks for in-progress merges and returns 'unmerged' if found * Branch objects expanded to include merging field when a branch is the base of an in-progress merge * Metafile object no longer differentiates merging status, only conflict status (Branch objects handle merging now) * BranchRibbon indicates unmerged based on branch.status instead of conflicted metafile count * Abort button enable via checks against merging branches instead of merging metafiles * Resolve button simplified to key off of merging branches in Explorer metafiles * Stage button checks for unstaged metafiles based on unmerged status instead of modified status * Remove unused isAbortable import * Metadata component checks for merging branches instead of merging metafiles * MergeDialog modal component checks for merging branches and updates accordingly * fetchMergingBranches checks for the existence of MERGE_MSG file before attempting to read * Remove unused SHA1 type import * Always enable Redux DevTools integration * Mock git-status for all fetchBranch tests that intrinsically check branch status * Mock git-status for all updateVersionedMetafile tests that intrinsically check branch status * Partial removal of strict RootState typing on useAppSelector usage
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Bug reports or bug fixes
dependencies
Issues or updates to dependency files
feature
Feature requests or improvements
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.
Description:
Consolidate branch merging information into
Branch
object, instead ofMetafile
object, and maintainunmerged
status for files even when conflicting chunks are resolved. Consistent state allows Button components to be correctly hidden when their actions are unavailable.This PR resolves #969, and signifies the following version changes (per Semantic Version):
Changes:
This PR makes the following changes:
Metadata
component for displaying metafile information using Material-UI's Table componentsMetafile.merging
field removed in favor ofBranch.merging
field to indicate when a branch is the base of an in-progress mergeEditor
component switched to relying onMetafile.content
field instead of maintaining local state viaReact.useState
hooksworktreeStatus
checks for in-progress merges and returnsunmerged
status if foundstderr
error ifFSCacheProvider
observes anunlinkDir
event on a file-only cached entryFSCacheProvider
tracksreserved
based onCard.id
instead ofMetafile.id
Metafile.status
field for all files contained in a directory when callingworktreeStatus
inupdateVersionedMetafile
worktreeStatus
when callingfileStatus
Metafile
fields when callingupdateFilebasedMetafile
andupdateVersionedMetafile
inlistenerMiddleware
duringcardAdded
orcardUpdated
action eventsMetafile.status
field to*modified
for directories associated with aBranch
that has anuncommitted
status when callingfileStatus
revertChanges
async thunk introduced to combine and simplify the previousrevertStagedChanges
andrevertUnmergedChanges
async thunks into a single thunk for resetting file content to the version maintained in the current git indexonHoverText
toStyledTreeComponent
to allow version status information to appear when hovering onFileComponent
objects in theExplorer
cardMetafile.status
instead ofMetafile.conflicts
field inselectByConflicted
selector in order to capture metafiles after all conflicts have been removed from the content (but not yet committed)??
) from TypeScript 3.7 to simplify inline logical expressionsBranchItem
component expanded to indicateunmerged
andlinked
branchesupdateBranch
async thunk updatesBranch.status
fieldBadge
component toCardComponent
to indicate the count of conflicting chunks in content onEditor
cardsutils.isConflicted
toutils.isUnmerged
to properly indicateunmerged
status differs from a metafile containing conflicting chunksupdateBranches
immediately afterRefresh
button click event to prevent displaying stale branch informationMetafile.status
for all descendant file objects whenupdateVersionedMetafile
is called on a directoryBranch.id
UUID as well as the requiredRepository.id
UUID when callingselectByConflicted
electron-devtools-installer
package todevDependencies
to auto install DevTool extensions into Electronredux-devtools
module in Electron appplugin:import/electron
and usesettings.import/modules: ["electron"]
instead for ESLint configurationConflictManager
card deprecated and removed in favor of managing conflicts on the back ofExplorer
cardsremoveObjectProperty
utility function for immutably removing properties from JavaScript objects in a type-safe mannerChecklist:
Before submitting this PR, I have verified that my code:
fix/
orfeature/
branch that was initially branched off fromdevelopment
.yarn lint
) and unit testing (yarn test
).yarn package
).