git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [ANNOUNCE] Git v1.9-rc0

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 27, 2014, 22:56 UTC
Message-ID
<xmqqy521m3tv.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140124233635.GA31371@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 25 quoted lines
> On Thu, Jan 23, 2014 at 10:15:33AM -0800, Junio C Hamano wrote:
>
>> Jeff King <peff@peff.net> writes:
>> 
>> > Junio, since you prepare such tarballs[1] anyway for kernel.org, it
>> > might be worth uploading them to the "Releases" page of git/git.  I
>> > imagine there is a programmatic way to do so via GitHub's API, but I
>> > don't know offhand. I can look into it if you are interested.
>> 
>> I already have a script that takes the three tarballs and uploads
>> them to two places, so adding GitHub as the third destination should
>> be a natural and welcome way to automate it.
>
> I came up with the script below, which you can use like:
>
>   ./script v1.8.2.3 git-1.8.2.3.tar.gz
>
> It expects the tag to already be pushed up to GitHub.  I'll leave
> sticking it on the "todo" branch and integrating it into RelUpload to
> you. This can also be used to backfill the old releases (though I looked
> on k.org and it seems to have only partial coverage).
>
> It sets the "prerelease" flag for -rc releases, but I did not otherwise
> fill in any fields, including the summary and description. GitHub seems
> to display reasonably if they are not set.
Thanks.
Show 12 quoted lines
> -- >8 --
> #!/bin/sh
> #
> # usage: $0 <tag> <tarball>
>
> repo=git/git
>
> # replace this with however you store your oauth token
> # if you don't have one, make one here:
> # https://github.com/settings/tokens/new
> token() {
>   pass -n github.web.oauth
Hmph, what is this "pass" thing?
Show 43 quoted lines
> }
>
> post() {
>   curl -H "Authorization: token $(token)" "$@"
> }
>
> # usage: create <tag-name>
> create() {
>   case "$1" in
>   *-rc*)
>     prerelease=true
>     ;;
>   *)
>     prerelease=false
>     ;;
>   esac
>
>   post -d '
>   {
>     "tag_name": "'"$1"'",
>     "prerelease": '"$prerelease"'
>   }' "https://api.github.com/repos/$repo/releases"
> }
>
> # use: upload <release-id> <filename>
> upload() {
>   url="https://uploads.github.com/repos/$repo/releases/$1/assets" &&
>   url="$url?name=$(basename $2)" &&
>   post -H "Content-Type: $(file -b --mime-type "$2")" \
>        --data-binary "@$2" \
>        "$url"
> }
>
> # This is a hack. If you don't mind a dependency on
> # perl's JSON (or another parser), we can do a lot better.
> extract_id() {
>   perl -lne '/"id":\s*(\d+)/ or next; print $1; exit 0'
> }
>
> create "$1" >release.json &&
> id=$(extract_id <release.json) &&
> upload "$id" "$2" >/dev/null &&
> rm -f release.json
Previous: Jeff KingNext: Jeff King
Message 15 of 20 in “What's cooking in git.git (Jan 2014, #03; Thu, 16)”
  1. Junio C HamanoJan 16, 2014
  2. [ANNOUNCE] Git v1.9-rc0Junio C Hamano, Jan 21, 2014
  3. Javier Domingo CansinoJan 22, 2014
  4. Junio C HamanoJan 22, 2014
  5. Stefan NäweJan 22, 2014
  6. Junio C HamanoJan 22, 2014
  7. Vicent MartíJan 22, 2014
  8. Junio C HamanoJan 22, 2014
  9. Ken MoffatJan 22, 2014
  10. Junio C HamanoJan 22, 2014
  11. Ken MoffatJan 22, 2014
  12. Jeff KingJan 23, 2014
  13. Junio C HamanoJan 23, 2014
  14. Jeff KingJan 24, 2014
  15. Junio C HamanoJan 27, 2014
  16. Jeff KingJan 28, 2014
  17. Kacper KornetJan 27, 2014
  18. Jonathan NiederJan 27, 2014
  19. Kacper KornetJan 28, 2014
  20. Sitaram ChamartyJan 30, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.