FreshPorts / git_proc_commit

Tools for processing git commits one at a time.
BSD 2-Clause "Simplified" License
0 stars 1 forks source link

Ideas for processing commits #19

Closed dlangille closed 4 years ago

dlangille commented 4 years ago

This came in from a post to the FreeBSD-git mailing list. I have permission to reproduce it here as it was not CC'd to the list.

Hi Dan, some suggestions below.

On Wed, Jul 15, 2020 at 11:43 PM Dan Langille dan@langille.org wrote:

Hello,

https://devgit.freshports.org/ is improving. Most of the git-specific work is at https://github.com/FreshPorts/git_proc_commit in the git-to-freshports directory.

There are several issues open, some for documentation purposes, other for tracking.

What I do need is a better icon for the git link: https://devgit.freshports.org/images/git.png

https://devgit.freshports.org/ is covering only ports head commits at present. This is because commits to a repo branch must be tracked separately. We are walking through the commits via these steps:

You should probably use a --bare --mirror clone to avoid messing around with thousands of files on disk.

  • git checkout master

It's probably better to create a specific ref, maybe LATEST to point to the last update (or track that in a separate database or something). That probably doesn't work with --mirror, but should work fine with --bare.

  • $startpoint=latest commit in our working copy : $(git log master..$REMOTE/master --oneline --reverse | head -n 1 | cut -d' ' -f1)

git log --format=%h -n1 --reverse LATEST..origin/master http://latest..origin/master

  • list of commits to process is: git rev-list startpoint..HEAD

Could then just be git rev-list LATEST..HEAD and once you're done processing you update-ref LATEST to point to HEAD

This will only cover commits on head for https://github.com/freebsd/freebsd-ports

We need a separate process for checking commits to 2020Q3.

stash it in LATEST/2020Q3 and do the revlist to origin/branches/2020Q3 ?

dlangille commented 4 years ago

I think we're good now. This helped.