Skip to content

Commit

Permalink
Prepare for release as a Raku Community Module
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Nov 17, 2024
1 parent 6d88f6f commit 97a9eb3
Show file tree
Hide file tree
Showing 14 changed files with 268 additions and 125 deletions.
16 changes: 0 additions & 16 deletions .editorconfig

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Linux

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:

jobs:
raku:
strategy:
matrix:
os:
- ubuntu-latest
raku-version:
- 'latest'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: Raku/setup-raku@v1
with:
raku-version: ${{ matrix.raku-version }}
- name: Run Special Tests
run: raku run-tests -i
26 changes: 26 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: MacOS

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:

jobs:
raku:
strategy:
matrix:
os:
- macos-latest
raku-version:
- 'latest'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: Raku/setup-raku@v1
with:
raku-version: ${{ matrix.raku-version }}
- name: Run Special Tests
run: raku run-tests -i
26 changes: 26 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Windows

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:

jobs:
raku:
strategy:
matrix:
os:
- windows-latest
raku-version:
- 'latest'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: Raku/setup-raku@v1
with:
raku-version: ${{ matrix.raku-version }}
- name: Run Special Tests
run: raku run-tests -i
13 changes: 0 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
## Perl 6 precompilation files ##
.precomp

## Editor files ##

# emacs
*~

# vim
.*.sw?

# comma
.idea
*.iml
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

24 changes: 11 additions & 13 deletions CHANGELOG.md → Changes
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Changelog
All notable changes to this project will be documented in this file.
Revision history for Git-Log

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic
Versioning](http://semver.org/spec/v2.0.0.html).
{{$NEXT}}
- Initial version as a Raku Community Module

## [0.1.0] - 2018-08-24
- Initial release

## [0.1.1] - 2018-08-24
- Make arguments to `git-log` slurpy.
## [0.2.0] - 2018-08-25
- :get-changes is now off by default
- The commit ID is now called "ID" by default, not "commit"

## [0.1.2] - 2018-08-25
- Disable the test since otherwise zef will not install Git::Log properly.
A new test will have to be added later.

## [0.2.0] - 2018-08-25
- :get-changes is now off by default
- The commit ID is now called "ID" by default, not "commit"
## [0.1.1] - 2018-08-24
- Make arguments to `git-log` slurpy.

## [0.1.0] - 2018-08-24
- Initial release
24 changes: 11 additions & 13 deletions META6.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
{
"api": "0",
"auth": "zef:raku-community-modules",
"authors": [
"Samantha McVey <samantham@posteo.net>"
"Samantha McVey"
],
"build-depends": [
],
"depends": [

],
"description": "Gets the git log as a Perl 6 object",
"description": "Gets the git log as a Raku object",
"license": "Artistic-2.0",
"support": {
"license": "http://www.perlfoundation.org/artistic_license_2_0",
"bugtracker": "https://github.com/samcv/perl6-Git-Log/issues"
},
"meta-version": 0,
"name": "Git::Log",
"perl": "6.c",
"provides": {
"Git::Log": "lib/Git/Log.pm6"
"Git::Log": "lib/Git/Log.rakumod"
},
"resources": [

],
"source-url": "https://github.com/samcv/perl6-Git-Log.git",
"source-url": "https://github.com/raku-community-modules/Git-Log.git",
"support": {
"bugtracker": "https://github.com/samcv/perl6-Git-Log/issues",
"license": "http://www.perlfoundation.org/artistic_license_2_0"
},
"tags": [

"GIT",
"LOG"
],
"test-depends": [
],
"version": "0.2.0"
}
62 changes: 37 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,58 @@
[![Actions Status](https://github.com/raku-community-modules/Git-Log/actions/workflows/linux.yml/badge.svg)](https://github.com/raku-community-modules/Git-Log/actions) [![Actions Status](https://github.com/raku-community-modules/Git-Log/actions/workflows/macos.yml/badge.svg)](https://github.com/raku-community-modules/Git-Log/actions) [![Actions Status](https://github.com/raku-community-modules/Git-Log/actions/workflows/windows.yml/badge.svg)](https://github.com/raku-community-modules/Git-Log/actions)

NAME
====

Git::Log

AUTHOR
======

Samantha McVey (samcv) <samantham@posteo.net>
Git::Log - Gets the git log as a Raku object

SYNOPSIS
========

Gets the git log as a Perl 6 object
Gets the git log as a Raku object

DESCRIPTION
===========

The first argument is the command line args wanted to be passed into `git log`. Optionally you can also get the files changes as well as the number of lines added or deleted.

Returns an array of hashes in the following format: `ID => "df0c229ad6ba293c67724379bcd3d55af6ea47a0", AuthorName => "Author's Name", AuthorEmail => "sample.email@not-a.url" ...` If the option :get-changes is used (off by default) it will also add a 'changes' key in the following format: `changes => { $[ { filename => 'myfile.txt', added => 10, deleted => 5 }, ... ] }`
Returns an array of hashes in the following format: `ID => "df0c229ad6ba293c67724379bcd3d55af6ea47a0", AuthorName => "Author's Name", AuthorEmail => "sample.email@not-a.url" ...`

If the option :get-changes is used (off by default) it will also add a 'changes' key in the following format: `changes => { $[ { filename => 'myfile.txt', added => 10, deleted => 5 }, ... ] }`

If there is a field that you need that is not offered, then you can supply an array, :@fields. Format is an array of pairs: `ID => '%H', AuthorName => '%an' ...` you can look for more [here](https://git-scm.com/docs/pretty-formats).

These are the default fields:

```perl6
```raku
my @fields-default =
'ID' => '%H',
'AuthorName' => '%an',
'AuthorEmail' => '%ae',
'AuthorDate' => '%aI',
'Subject' => '%s',
'Body' => '%b'
ID => '%H',
AuthorName => '%an',
AuthorEmail => '%ae',
AuthorDate => '%aI',
Subject => '%s',
Body => '%b'
;
```

EXAMPLES
========

```perl6
# Gets the git log for the specified repository, from versions 2018.06 to master
git-log(:path($path.IO), '2018.06..master')
```raku
# Gets the git log for the specified repository,
# from versions 2018.06 to main
git-log(:path($path.IO), '2018.06..main')

# Gets the git log for the current directory, and does I<not> get the files
# changed in that commit
git-log(:!get-changes)
```

LICENSE
=======

This is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

### sub git-log

```perl6
```raku
sub git-log(
*@args,
:@fields = { ... },
:@fields = Code.new,
IO::Path :$path,
Bool:D :$get-changes = Bool::False,
Bool:D :$date-time = Bool::False
Expand All @@ -65,3 +61,19 @@ sub git-log(

git-log's first argument is an array that is passed to C<git log> and optionally you can provide a path so a directory other than the current are used.

AUTHOR
======

Samantha McVey

Source can be located at: https://github.com/raku-community-modules/Git-Log . Comments and Pull Requests are welcome.

COPYRIGHT AND LICENSE
=====================

Copyright 2018 Samantha McVey

Copyright 2024 The Raku Community

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

11 changes: 11 additions & 0 deletions dist.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name = Git-Log

[ReadmeFromPod]
filename = lib/Git/Log.rakumod

[UploadToZef]

[Badges]
provider = github-actions/linux.yml
provider = github-actions/macos.yml
provider = github-actions/windows.yml
3 changes: 0 additions & 3 deletions gen-md.sh

This file was deleted.

Loading

0 comments on commit 97a9eb3

Please sign in to comment.