Brad Lucas

Programming, Clojure and other interests

Git Scripts - First Commit Authors

June 17, 2017

Overview

When you work in an organization with a large number of repoositories created over time there is sometimes a need to figure who created what. You want to know who was the author of each repo.

The following three scripts can help with this.

The first get-first-commit-log.sh will show you who was the first committer to a repo. You run it in the directory of a repo.

#!/bin/bash
# @see http://stackoverflow.com/a/5189296

# If the repo has no commits you'll get the following
# fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
# Use '--' to separate paths from revisions, like this:
# 'git <command> [<revision>...] -- [<file>...]'
#
# Using 2> /dev/null to ignore these

git log $(git rev-list --max-parents=0 HEAD 2> /dev/null) 2> /dev/null

Continue reading →

Up Early New York

June 16, 2017

Up Early

3, 4, 5

Train

Grand Central at 6 am


Continue reading →

Clojure NYC Report

June 15, 2017

Making SQL More Like Datomic With Clojure

Clojure NYC had another great talk last night with Michael Gaare of Ladders introducing his library sqlium. Michael has taken his experience with Datomic and has created a DSL for querying SQL databases with a Dataomic-like flavor.

The source for the library was just put up on GitHub last night at https://github.com/TheLadders/sqlium. It will be interesting to see how the library does as others start using it.

As a next step, it would be good if the source Michael demonstrated last night which used the MusicBrainz data set was published somewhere for review as well.

Background


Continue reading →

Release Procedures

June 14, 2017

Some Rules

  • No releases after hours unless previously negotiated
  • Reponsible parties need to be present during the release
    • ie, Developer and Ops
  • Different systems have different release requirements
    • All have dependencies
    • Need to know roll back procedure
    • And, how to know if a roll back is necessary
  • The release may have ‘other‘ tasks. These should be documented and have been previously tested
    • Any env settings, configuration setting changes
    • Database changes
    • Systems that need to be stopped and started as part of the release
    • The ‘recipe‘ should be published
    • The ‘recipe‘ should have been followed in a ‘testing/staging‘ environment

Source Control

  • Use Git Flow
  • Releases are from release/VERSION_NUMBER branches
  • All code should be reviewed if necessary and merged to ‘develop‘ prior to release
    • ie, releases are branched from a stable state
  • Releases are numbered with a x.x.x format
    • Each release should increment intelligently
    • If any confusion get it sorted out ahead of time
  • DevOps will deploy the branch unless previously negotiated

Checklist


Continue reading →

Juxt

June 13, 2017

Overview

While cleaning out some old Gists I found a function I wrote six years ago using Clojure's juxt function.

The gist is here:

https://gist.github.com/bradlucas/1233763

To save a click I'll put the function here after fixing the embarassing typo in the comment.


Continue reading →