Skip to content

Commit 367e317

Browse files
Update README
1 parent 38c9082 commit 367e317

1 file changed

Lines changed: 28 additions & 26 deletions

File tree

README.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,38 @@
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, it becomes a source of tooling
35-
difficulty with requiring merge hooks or 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+
on storing the version identifier in a file, attached to some
24+
point in the history of the repository.
25+
26+
The problem with sticking a version identifier in the filesystem/version
27+
history is that it becomes a source of merge conflicts. To avoid the
28+
merge conflicts, teams sometimes build complicated merge hooks or
29+
automated workflows. Now you have two problems.
30+
31+
In monorepo patterns ala
32+
[lein-modules](https://github.com/jcrossley3/lein-modules), the problems
33+
above become amplified. Additionally, versions for inter-monorepo dependencies
34+
are not very meaningful as all dependencis are built from the same source
35+
commit, rather than depending on a specific Maven version identifier.
36+
Using a commit ID or version control tag/label is a more accurate and useful.
4437

4538
## Usage
4639

@@ -90,7 +83,7 @@ arbitrary function of the current git status by specifying a
9083
`status-to-version` function of the above status structure in the
9184
`:git-version` map of your `project.clj`.
9285

93-
For instance, lein-git-version an earlier version of itself uses
86+
For instance, lein-git-version uses an earlier version of
9487
itself to compute its own version.
9588

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

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

145147
Copyright © 2017 Reid McKenzie

0 commit comments

Comments
 (0)