Skip to content
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

OPT: Faster approach to GitRepo.format_commit() #4807

Merged
merged 1 commit into from Aug 6, 2020
Merged

Conversation

mih
Copy link
Member

@mih mih commented Aug 6, 2020

The previous git-show can be slow with more complex commits (e.g.
octopus merge commit, see gh-4801)

Switch to git-log as suggested in #4801.

Companion of #4806

@codecov
Copy link

codecov bot commented Aug 6, 2020

Codecov Report

Merging #4807 into maint will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            maint    #4807      +/-   ##
==========================================
- Coverage   89.67%   89.65%   -0.02%     
==========================================
  Files         288      288              
  Lines       40352    40352              
==========================================
- Hits        36184    36179       -5     
- Misses       4168     4173       +5     
Impacted Files Coverage Δ
datalad/support/gitrepo.py 90.37% <100.00%> (-0.08%) ⬇️
datalad/core/distributed/clone.py 88.62% <0.00%> (-0.60%) ⬇️
datalad/support/tests/test_annexrepo.py 96.59% <0.00%> (-0.16%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf54d79...01c5a68. Read the comment docs.

kyleam
kyleam approved these changes Aug 6, 2020
Copy link
Collaborator

@kyleam kyleam left a comment

Looks good to me.

My only nit is that a comment might prevent that log from getting rewritten as show way down the road.

If anyone doesn't have an octopus merge at hand and wants to observe the slowness:

octopus script
set -eu
cd "$(mktemp -d "${TMPDIR:-/tmp}"/dl-XXXXXXX)"

git init
git commit --allow-empty -mc0

N=500
base=$(git symbolic-ref --short HEAD)
for i in $(seq 1 $N)
do
    git checkout -b b$i $base
    :>f$i
    git add f$i
    git commit -m"f$i"
done

git checkout $base
git merge -m"merge" $(seq --format="b%g" --separator=" " 1 $N)

@mih
Copy link
Member Author

mih commented Aug 6, 2020

Thx @kyleam will add that comment

The previous git-show can be slow with more complex commits (e.g.
octopus merge commit, see dataladgh-4801)

Switch to `git-log`
@mih
Copy link
Member Author

mih commented Aug 6, 2020

Force-pushed missing comment. Thx @kyleam

kyleam
kyleam approved these changes Aug 6, 2020
Copy link
Collaborator

@kyleam kyleam left a comment

Thanks!

@mih mih merged commit d8cb4c5 into datalad:maint Aug 6, 2020
3 of 4 checks passed
@mih mih deleted the bf-4801-2 branch Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants