Skip to content

Conversation

@ffjlabo
Copy link
Member

@ffjlabo ffjlabo commented Jan 26, 2024

What this PR does / why we need it:
Set 'gc.autoDetach' to false to be executed 'git gc' in the foreground by some git commands
Which issue(s) this PR fixes:

Fixes #4760

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

…d by some git commands

Signed-off-by: Yoshiki Fujikane <[email protected]>
@codecov
Copy link

codecov bot commented Jan 26, 2024

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (8e302a8) 31.04% compared to head (fabae49) 31.04%.
Report is 2 commits behind head on master.

Files Patch % Lines
pkg/git/client.go 70.00% 2 Missing and 1 partial ⚠️
pkg/git/repo.go 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4761      +/-   ##
==========================================
- Coverage   31.04%   31.04%   -0.01%     
==========================================
  Files         225      225              
  Lines       26257    26273      +16     
==========================================
+ Hits         8152     8156       +4     
- Misses      17455    17464       +9     
- Partials      650      653       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Yoshiki Fujikane <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]>
@ffjlabo ffjlabo force-pushed the enable-executing-git-gc-in-the-foreground branch from e1dbe3a to 55a801a Compare January 29, 2024 08:28
Signed-off-by: Yoshiki Fujikane <[email protected]>
@ffjlabo ffjlabo force-pushed the enable-executing-git-gc-in-the-foreground branch from 55a801a to fabae49 Compare January 29, 2024 08:51
@ffjlabo
Copy link
Member Author

ffjlabo commented Jan 29, 2024

✅ tested the behavior of cloning a repo, especially with pipectl plan-preview on local :)

log↓

received a plan-preview command to handle	{"command": "c0c563fb-7a78-43d3-ad5e-8e45f0f7cbf8"}
start building planpreview result for command c0c563fb-7a78-43d3-ad5e-8e45f0f7cbf8	{"command": "c0c563fb-7a78-43d3-ad5e-8e45f0f7cbf8"}
cloning ffjlabo-dev for the first time	{"repo-id": "ffjlabo-dev", "remote": "XXX", "repo-cache-path": "/var/folders/th/pq_q9v6j6_n_0fgx6v1_zp09_2tx_x/T/gitcache651340412/ffjlabo-dev"}
cloning a repo from cached one in local	{"repo-id": "ffjlabo-dev", "remote": "XXX", "repo-cache-path": "/var/folders/th/pq_q9v6j6_n_0fgx6v1_zp09_2tx_x/T/gitcache651340412/ffjlabo-dev", "src": "/var/folders/th/pq_q9v6j6_n_0fgx6v1_zp09_2tx_x/T/gitcache651340412/ffjlabo-dev", "dst": "/var/folders/th/pq_q9v6j6_n_0fgx6v1_zp09_2tx_x/T/plan-preview-builder-1425043400/1752730028"}
setting gc.autoDetach	{"repo-id": "ffjlabo-dev", "remote": "XXX", "repo-cache-path": "/var/folders/th/pq_q9v6j6_n_0fgx6v1_zp09_2tx_x/T/gitcache651340412/ffjlabo-dev", "gc.autoDetach": true}
successfully reported a failure command	{"command": "c0c563fb-7a78-43d3-ad5e-8e45f0f7cbf8"}

git config of the repo cloned for plan-preview↓

% cd /var/folders/th/pq_q9v6j6_n_0fgx6v1_zp09_2tx_x/T/plan-preview-builder-1425043400/1752730028                    (git)-[main|merge]
% /var/folders/th/pq_q9v6j6_n_0fgx6v1_zp09_2tx_x/T/plan-preview-builder-1425043400/1752730028
% git config --get gc.autoDetach                                                                                    (git)-[main|merge]
true

@ffjlabo ffjlabo marked this pull request as ready for review January 29, 2024 09:05
Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you go 🪨

Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GREAT🚀 🚀

@ffjlabo ffjlabo merged commit 3446a87 into master Feb 2, 2024
@ffjlabo ffjlabo deleted the enable-executing-git-gc-in-the-foreground branch February 2, 2024 01:04
t-kikuc pushed a commit that referenced this pull request Feb 2, 2024
…d by some git commands (#4761)

* Set 'gc.autoDetach' to false to be executed 'git gc' in the foreground by some git commands

Signed-off-by: Yoshiki Fujikane <[email protected]>

* Add log for setting gc.autoDetach

Signed-off-by: Yoshiki Fujikane <[email protected]>

* Rename to setGCAutoDetach

Signed-off-by: Yoshiki Fujikane <[email protected]>

* Add test for setGCAutoDetach

Signed-off-by: Yoshiki Fujikane <[email protected]>

* Refactor

Signed-off-by: Yoshiki Fujikane <[email protected]>

---------

Signed-off-by: Yoshiki Fujikane <[email protected]>
@ffjlabo
Copy link
Member Author

ffjlabo commented Feb 2, 2024

Ooops... I mistook the default value... not true but false... Sorry I will fix it 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Enable to execute 'git gc' in the foreground

4 participants