Problem Description
When viewing a specific branch by clicking the "Show" button next to a branch tip, the extension always uses a hardcoded -n 15000 parameter, regardless of the -n value saved in the main view configuration. This causes performance issues when working with repositories that have very long commit histories, as the extension loads 15,000 commits even if the user has configured a smaller value (e.g., -n 1000) in the main view.
Use Case
- User opens GitLG and configures the main log command with
-n 1000 (or any other value) to improve performance
- User saves this configuration
- User clicks on a commit to view its details
- User clicks "Show" button next to a branch tip in the commit details panel
- Issue: The extension loads 15,000 commits instead of using the saved
-n 1000 value, causing the same performance problems the user was trying to avoid
Current Behavior
- The main view respects the saved
-n parameter from the "Configure..." panel
- When clicking "Show" on a branch tip, it always uses
-n 15000 (hardcoded in web/src/data/store/index.js, line 98)
Expected Behavior
When clicking "Show" on a branch tip, the extension should:
- Check if the user has saved a custom
-n parameter in the main log configuration
- If found, use that saved value instead of the hardcoded
15000
- Fall back to
15000 only if no custom configuration exists
Proposed Solution
Modify the show_branch function in web/src/data/store/index.js to read the saved configuration from state('git input config main-log') and extract the -n parameter value from the saved command string.
Example implementation approach:
export let show_branch = (/** @type {Branch} */ branch_tip) => {
// Read saved configuration
let saved_config = state('git input config main-log', { command: '', options: [] }).ref
let n_value = '15000' // default fallback
if (saved_config.value?.command) {
// Extract -n parameter from saved command
let match = saved_config.value.command.match(/-n\s+(\d+)/)
if (match) {
n_value = match[1]
}
}
return trigger_main_refresh({
custom_log_args: ({ base_log_args }) =>
`${base_log_args} -n ${n_value} ${branch_tip.id}`,
fetch_stash_refs: false,
})
}
Additional Context
- This issue affects users with large repositories where loading 15,000 commits causes noticeable lag
- The workaround of manually editing the command in "Configure..." works for the main view, but doesn't help when viewing specific branches
- Similar behavior might also exist in
show_commit_hash function (line 106), which uses -n 500 - though this might be intentional for commit-specific views
Related Files
web/src/data/store/index.js (lines 95-100: show_branch function)
web/src/components/GitInput.vue (handles saving/loading configuration)
web/src/data/store/repo.js (defines log_action with storage_key: 'main-log')
Thank you for considering this feature request! This would significantly improve the user experience when working with large repositories.
Problem Description
When viewing a specific branch by clicking the "Show" button next to a branch tip, the extension always uses a hardcoded
-n 15000parameter, regardless of the-nvalue saved in the main view configuration. This causes performance issues when working with repositories that have very long commit histories, as the extension loads 15,000 commits even if the user has configured a smaller value (e.g.,-n 1000) in the main view.Use Case
-n 1000(or any other value) to improve performance-n 1000value, causing the same performance problems the user was trying to avoidCurrent Behavior
-nparameter from the "Configure..." panel-n 15000(hardcoded inweb/src/data/store/index.js, line 98)Expected Behavior
When clicking "Show" on a branch tip, the extension should:
-nparameter in the main log configuration1500015000only if no custom configuration existsProposed Solution
Modify the
show_branchfunction inweb/src/data/store/index.jsto read the saved configuration fromstate('git input config main-log')and extract the-nparameter value from the saved command string.Example implementation approach:
Additional Context
show_commit_hashfunction (line 106), which uses-n 500- though this might be intentional for commit-specific viewsRelated Files
web/src/data/store/index.js(lines 95-100:show_branchfunction)web/src/components/GitInput.vue(handles saving/loading configuration)web/src/data/store/repo.js(defineslog_actionwithstorage_key: 'main-log')Thank you for considering this feature request! This would significantly improve the user experience when working with large repositories.