For some time I've been championing the use of git "shallow clones 
<https://www.google.com/search?q=git+shallow+clone>" when working with Leo 
in order to dramatically speed up new clones 
<https://groups.google.com/d/topic/leo-editor/gAGkwkS8Vlo/discussion>. 
There's a side effect though: you don't get any information about the 
branches which have current activity but weren't named when creating the 
shallow clone (unless you use --no-single-branch option, which I often 
forget).

Here's <https://gist.github.com/maphew/1b706e66e87919dbd2538f21b6ea9f26> a 
simplistic-but-works bash remedy (for Github repos only, see this 
<https://stackoverflow.com/questions/58702233/git-shallow-clone-only-branches-with-activity-last-x-months>Stack
 
Overflow thread for background):

export URL=https://github.com/leo-editor/leo-editor/branches/active
curl $URL > x.html
printf '\n-- Commands to add the remote branches to the fetch list:\n'
grep 'data-branch-name' x.html | sed -r 's/^.*data-branch-name="(.*?)"(.*$)/git 
remote set-branches --add origin \1/'
printf '\n-- Modification dates for these branches:\n'
grep 'time-ago' x.html | sed -r 's/^.*datetime="(....-..-..).*$/\1/'

The script doesn't add the remotes, just tells you what commands to run in 
copy-pastable form. After adding the remotes update your local status info 
with `git fetch`.

For bash scripts on on Windows I use GitExtensions which comes with the 
MingW bash shell; see the [console] panel.

-matt

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/966b0822-de53-458f-a340-411287c18f4b%40googlegroups.com.

Reply via email to