[PATCH] Add gitless package definition.

  • Done
  • quality assurance status badge
Details
2 participants
  • John D. Boy
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
John D. Boy
Severity
normal
J
J
John D. Boy wrote on 11 Mar 2020 16:11
(address . guix-patches@gnu.org)
20200311151137.32198-1-jboy@bius.moe
---
gnu/packages/version-control.scm | 50 ++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)

Toggle diff (60 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 52626f8076..7aac933d15 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -2373,3 +2373,53 @@ interrupted, published, and collaborated on while in progress.")
videos, datasets, and graphics with text pointers inside Git, while storing the
file contents on a remote server.")
(license license:expat)))
+
+(define-public gitless
+ (package
+ (name "gitless")
+ ;; The PyPI package lacks the test suite, so we build it directly from the
+ ;; git repository.
+ (version "0.8.8")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gitless-vcs/gitless")
+ (commit (string-append "v" version))))
+ (sha256
+ (base32 "048kl27zjr68hgs70g3l98ci9765wxva6azzrhcdys7nsdd493n6"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'loosen-requirements
+ (lambda _
+ (substitute* "setup.py"
+ ;; Don't insist on an older version of pygit2.
+ (("pygit2==") "pygit2>="))
+ (substitute* "requirements.txt"
+ (("pygit2==") "pygit2>="))
+ #t))
+ (add-before 'check 'prepare-for-tests
+ (lambda _
+ ;; Find the 'gl' command.
+ (rename-file "gl.py" "gl")
+ (setenv "PATH" (string-append (getcwd) ":" (getenv "PATH")))
+ ;; The tests try to run git as if it were already set up.
+ (setenv "HOME" (getcwd))
+ (invoke "git" "config" "--global" "user.email" "git@example.com")
+ (invoke "git" "config" "--global" "user.name" "guix")
+ #t)))))
+ (native-inputs
+ ;; Required for tests.
+ `(("git-minimal" ,git-minimal)))
+ (propagated-inputs
+ `(("python-clint" ,python-clint)
+ ("python-pygit2" ,python-pygit2)
+ ("python-sh" ,python-sh)))
+ (home-page "https://gitless.com")
+ (synopsis
+ "A version control system built on top of Git")
+ (description
+ "A version control system built on top of Git")
+ (license license:expat)))
--
2.20.1
T
T
Tobias Geerinckx-Rice wrote on 11 Mar 2020 20:05
(address . 40025@debbugs.gnu.org)
87wo7qhfuw.fsf@nckx
John,

Thanks for the patch!

Guix uses a specific commit message format. It's partially
documented in ‘(guix)Submitting Patches’ but you're IMO better off
just reading the git history to get a feel for it. Here's the
commit message for this package:

gnu: Add gitless.

* gnu/packages/version-control.scm (gitless): New public
variable.

Co-authored-by: Tobias Geerinckx-Rice <me@tobias.gr>

I've written down my comments below, but you don't need to send a
V2.

I'll try to make it work here and will push a modified version if
I succeed. It would be nice if I could get rid of propagation,
and the path to a (non-native) git still needs to be embedded so
the user doesn't need to install git themselves.

Toggle quote (4 lines)
> + (uri (git-reference
> + (url "https://github.com/gitless-vcs/gitless")
> + (commit (string-append "v" version))))

This is missing the FILE-NAME field. Without it, the source is
checked out into /gnu/store/<hash>-checkout/ which makes it harder
to see what's what.

Adding (file-name (git-file-name name version)) puts it in
/gnu/store/<hash>-gitless-<version>-checkout.

Toggle quote (3 lines)
> + (substitute* "requirements.txt"
> + (("pygit2==") "pygit2>="))

This has no effect on the end result so I suggest we drop it
again.

Toggle quote (3 lines)
> + (synopsis
> + "A version control system built on top of Git")

Synopses shouldn't start with an article.

Tip: running ‘./pre-inst-env guix lint gitless’ will catch things
like this. It also caught the missing FILE-NAME.

It also printed several warnings about using tabs instead of
spaces. Guix does not use tabs in Scheme code.

Toggle quote (3 lines)
> + (description
> + "A version control system built on top of Git")

This is waaay too short, I told you that before :-p Moreover,
descriptions should consist of complete sentences. I've knocked
something together based on the home page blurb:

Gitless is a Git-compatible version control system that aims to
be
easy to learn and use. It simplifies the common workflow by
committing changes to tracked files by default and saving any
uncommitted changes as part of a branch.

The friendly @command{gl} command-line interface gives feedback
and
helps you figure out what to do next.

Gitless is implemented on top of Git and its commits and
repositories
are indistinguishable from Git's. You (or other contributors)
can
always fall back on @command{git}, and use any regular Git
hosting
service.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfo+u0AlEeO9y5k0W2Imw8BjFSTwFAl5pNncACgkQ2Imw8BjF
STwnZxAAnyk4VTO2C6FgbErtYghtq1fQ5WUsjxfUMofYv9IjF4TFf1hQiI6Ssb5Y
TvbpPIC+6d+cht0sI1X8eWZZ1TH/fkyfNoczUI52nzgAR6IQZAqNRKOhtWZhjPGN
lXe0bnqE+x3Mba/Nus0g+jUi9BDzZ7w0e95mKHytxgCPSsfqRJ+Uh13TI/SMlkWM
SbtrJhaHkR0OfwrvhyQLyIZVu88doUrB1tvZfSftnJ1IZy2WEsSnVJK2Mx+aTPMR
2WOH/8hcURJeeEccHWAWbB0NQMHslohk+tZmmZ4Pw89vboGfy9+pgDOL+E6vaRkD
WS/8Bom9uVtc2TuLBPDBblRXP4o3mMBXBWolNr96T85G5kDDseI/OA8XtuAPY4BW
mFrjjyJ2nGQAEN/ItVQkBX/F0Y84WqLc5lZhNkvnw3gvJADKHxOgJBHc3goXgp1p
WIelWgSmqVcesBR9D3EAwzTb+89VDaRavmPFM4Ri7KCH2qOqI3+qqmgCV5R6VKoO
TpNwakp3pxGJy6d608xTL7PmiZIZTJyAqgCT73m4Rmvct0kIAOwRSiDECKp8cwOy
ZZ8aAFKGJL0OcQ8TCd4HL8OTjUtnhaUQhJ4+03i/4hw3Z11nzai6uQUS8E4Iq/SI
PUO2wve0PF4j8lGngBnTnZW03eIiRn/S2VQx7yz1+PWdxfmPx7o=
=mSi5
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 12 Mar 2020 05:17
(address . 40025-done@debbugs.gnu.org)
87r1xygqbd.fsf@nckx
Tobias Geerinckx-Rice via Guix-patches via ???
Toggle quote (8 lines)
> I'll try to make it work here and will push a modified version
> if I
> succeed. It would be nice if I could get rid of propagation,
> and the
> path to a (non-native) git still needs to be embedded so the
> user
> doesn't need to install git themselves.

Done and done. I added a copyright line for you and (using this
package) pushed this to master as
f930814afae8e20125dab58b060a691ea8398e26.

Thanks!

T G-R
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfo+u0AlEeO9y5k0W2Imw8BjFSTwFAl5pt8YACgkQ2Imw8BjF
STwOfw//Wr7im0TOoBGzXh9stYE5nvxaNmaGNfbnN8RAIuc1vN20EadNQE5k2s4A
6kw526fzuun1JUJ4jHOpXOEpQxd9ZmctImj+tRqsLYwIqbb/ilEGYS4xRb/1l9J0
hYuCCUjtw0hWx10RpVYcgqbKpCkQ6FF0b9dxXx57p0KOAagc+yFgqUX++2WOWC6T
0AErmS8R+ICTfnFryBRLF1yMXvo6h79web5o+nNzAm8uYNEwcoxGqkUl3H4nT88l
FcLncP34lQrBUZaR1OqDxWxVThDxNX5W55ZYd/G0o2tNal3asEpo0Utjy659uWnp
EjLhS3A7PNSoCLFfOgdG9xuJCZvPer0ZOZd/cwMQGrGWcHnkNTHSk0wgCTUQ0ycG
cuM8SRabOlaoQ/9b+T+4307xzu/vOdsQxlVrgerM3MynIFTKqmq6PSMbjW6jSetn
ftvE79+9hreR0ZJTe4duou0xAkZ3ninsNBguTwTkI/phx4EbZPMeXeFIjqpet1ak
RhvxIwuVLoE1+1sdlWs5ZFoapUMGNphHXDllvEciIgaiIQYRtxHNEhAHtWKACUL0
NqiUGfvAc8RiOryqvUKN4iZTvl6Xw5dMg+4rnLW0ACs2gsxb34Tg7pEy5A54V8lP
XyVHtpb9o8B3WiEplurlQ1rGGjJUSR00k11kdX3aKCrOLK9PsDc=
=RQkp
-----END PGP SIGNATURE-----

Closed
?