Skip to content

Commit b1e1088

Browse files
authored
Merge pull request cvillecsteele#1 from danielcompton/patch-1
Update README
2 parents d051048 + dd039d5 commit b1e1088

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

README.md

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,39 @@
22

33
[![Clojars Project](https://img.shields.io/clojars/v/me.arrdem/lein-git-version.svg)](https://clojars.org/me.arrdem/lein-git-version)
44

5-
This repo is a fork and to my taste a massive cleanup of
6-
[cvillecsteele's
7-
lein-git-version](https://github.com/cvillecsteele/lein-git-version)
8-
which is itself an un-maintained alternative to
9-
[michalmarczyk's](https://github.com/michalmarczyk/lein-git-version)
10-
original project.
5+
Derive your Leiningen project version from your Git history.
116

127
## Motivation
138

149
Leiningen projects, in their heritage from Maven, list an explicit
1510
version as the 3rd element of a `project.clj` file. For instance
1611

1712
```clojure
18-
(defproject foo "some-version"
13+
(defproject foo "1.3.4"
1914
...)
2015
```
2116

22-
There are a couple problems with this. First of all, until the
17+
There are a couple of problems with this. First of all, until the
2318
arrival of `leiningen.release/bump-version` for the `lein release`
2419
task, there was really no sane way to update the version of a property
25-
short of a sed script which just rewrote the `project.clj`.
20+
short of a sed script to rewrite the `project.clj`.
2621

2722
While `bump-version` is a mostly acceptable solution, it still relies
28-
on the filesystem (or to be more specific a code repository)
29-
reflecting in a file under version control the logical identifier
30-
attached to some point in the history of the repository.
31-
32-
The problem with sticking a version identifier in the filesystem is
33-
that it becomes a source of merge conflicts when multiple people are
34-
collaborating on an artifact, and it may be difficult to automate
35-
vesion management using merge hooks in workflows with automated
36-
commits that can be difficult to implement.
37-
38-
Moreover, in monorepo patterns ala
39-
[lein-modules](https://github.com/jcrossley3/lein-modules), versions
40-
for shared libraries which are distributed only as a component of
41-
artifacts in the repository are no longer particularly a meaningful
42-
construct. The commit ID or the version control label is the most
43-
meaningful identifier.
23+
24+
on storing the version identifier in a file, attached to some
25+
point in the history of the repository.
26+
27+
The problem with sticking a version identifier in the filesystem/version
28+
history is that it becomes a source of merge conflicts. To avoid the
29+
merge conflicts, teams sometimes build complicated merge hooks or
30+
automated workflows. Now you have two problems.
31+
32+
In monorepo patterns ala
33+
[lein-modules](https://github.com/jcrossley3/lein-modules), the problems
34+
above become amplified. Additionally, versions for inter-monorepo dependencies
35+
are not very meaningful as all dependencis are built from the same source
36+
commit, rather than depending on a specific Maven version identifier.
37+
Using a commit ID or version control tag/label is a more accurate and useful.
4438

4539
## Usage
4640

@@ -90,7 +84,7 @@ arbitrary function of the current git status by specifying a
9084
`status-to-version` function of the above status structure in the
9185
`:git-version` map of your `project.clj`.
9286

93-
For instance, lein-git-version an earlier version of itself uses
87+
For instance, lein-git-version uses an earlier version of
9488
itself to compute its own version.
9589

9690
```clojure
@@ -140,6 +134,15 @@ control, a source control ignored eg `"gen-resources/..."` directory
140134
be used to isolate generated build artifacts from user
141135
sources. Remember to add the target to your project's `:resource-paths`!
142136

137+
## History
138+
139+
This repo is a fork and to my taste a massive cleanup of
140+
[cvillecsteele's
141+
lein-git-version](https://github.com/cvillecsteele/lein-git-version)
142+
which is itself an un-maintained alternative to
143+
[michalmarczyk's](https://github.com/michalmarczyk/lein-git-version)
144+
original project.
145+
143146
## License
144147

145148
Copyright © 2017 Reid McKenzie

0 commit comments

Comments
 (0)