You are not logged in.

#1 2017-07-03 10:39:18

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Programmatically get package changes from svntogit

I have a couple of packages in a local repository, which are modified core/extra/community packages. To update them I'd like to write a wrapper script that gets me the lastest commits to the official PKGBUILDs, starting from the first commit after the build date of my package going to the last commit that belongs to a non-testing repository. If possible I'd like to not clone the git repository.
What I found so far is that I can use

git remote-ls https://git.archlinux.org/svntogit/$repo.git/ $package

to get one commit. However, this won't be enough if I miss an update to the official package.
Having the commit hashes would probably be enough for me, as I can simply

curl https://git.archlinux.org/svntogit/$repo.git/patch/?id=$hash

Edit: asp difflog does something close, but shows the full log, not limited to the current changes. Also I don't need it to checkout the whole package history.

Last edited by FlowIt (2017-07-03 12:39:04)

Offline

#2 2017-07-05 05:23:59

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Programmatically get package changes from svntogit

Sounds like you want to reimplement asp, but making use of git's --depth or --shallow-since flags.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2017-07-05 10:09:14

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Re: Programmatically get package changes from svntogit

Yes probably, but I'm happy to reuse whatever I can. Currently, the most interesting question, where also asp does not help, is: How can I limit the difflog to only the changes which were made to the stable package? I only took a short look into git --shallow-since, but it seems to work only for days, which won't be finegranular enough.

Offline

#4 2017-07-05 13:06:08

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: Programmatically get package changes from svntogit

shallow-since should be good enough. After you have cloned all new commits, you can narrow down the commits with parameters for "git log", e.g. by appending "-- <path>"


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2017-07-05 15:28:41

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Programmatically get package changes from svntogit

Once you have cloned it once, I would suggest caching it and doing:

git log -p @{1}..@{0}

(I aliased this as `git new`)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB