Skip to content

Commit 2f3607a

Browse files
committed
Initial import
0 parents  commit 2f3607a

25 files changed

+4033
-0
lines changed

.dir-locals.el

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
((emacs-lisp-mode
2+
(indent-tabs-mode . nil))
3+
(makefile-gmake-mode
4+
(outline-regexp . "##"))
5+
(git-commit-mode
6+
(git-commit-major-mode . git-commit-elisp-text-mode)))

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/config.mk

CHANGELOG

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# -*- mode: org -*-
2+
3+
* v0.1.0 UNRELEASED
4+
5+
- Initial alpha release.

LICENSE

+676
Large diffs are not rendered by default.

Makefile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
-include config.mk
2+
include default.mk
3+
4+
.PHONY: lisp clean
5+
6+
all: lisp
7+
8+
help:
9+
$(info make all - generate byte-code and autoloads)
10+
$(info make lisp - generate byte-code and autoloads)
11+
$(info make clean - remove byte-code and autoloads)
12+
@printf "\n"
13+
14+
lisp:
15+
@$(MAKE) -C lisp lisp
16+
17+
clean:
18+
@$(MAKE) -C lisp clean
19+

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Work with Git forges from the comfort of Magit
2+
==============================================
3+
4+
Work with Git forges, such as Github and Gitlab, from the comfort
5+
of Magit and the rest of Emacs.
6+
7+
Only Github is fully supported at the moment. The schema of the
8+
database has not been finalized yet. Until that has happened it
9+
will occationally have to be discard. For now the database does
10+
not contain any information that cannot simply be fetched again.

default.mk

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
PKG = forge
2+
3+
ELS += $(PKG)-db.el
4+
ELS += $(PKG)-core.el
5+
ELS += $(PKG).el
6+
ELS += $(PKG)-repo.el
7+
ELS += $(PKG)-post.el
8+
ELS += $(PKG)-topic.el
9+
ELS += $(PKG)-issue.el
10+
ELS += $(PKG)-pullreq.el
11+
ELS += $(PKG)-notify.el
12+
ELS += $(PKG)-revnote.el
13+
ELS += $(PKG)-github.el
14+
ELS += $(PKG)-gitlab.el
15+
ELS += $(PKG)-bitbucket.el
16+
ELS += $(PKG)-gitea.el
17+
ELS += $(PKG)-gogs.el
18+
ELS += $(PKG)-commands.el
19+
ELS += $(PKG)-list.el
20+
ELCS = $(ELS:.el=.elc)
21+
22+
DEPS = closql
23+
DEPS += dash
24+
DEPS += emacsql
25+
DEPS += ghub
26+
DEPS += graphql
27+
DEPS += magit/lisp
28+
DEPS += magit-popup
29+
DEPS += markdown-mode
30+
DEPS += treepy
31+
DEPS += with-editor
32+
33+
EMACS ?= emacs
34+
EMACS_ARGS ?=
35+
36+
LOAD_PATH ?= $(addprefix -L ../../,$(DEPS))
37+
LOAD_PATH += -L .

lisp/Makefile

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
-include ../config.mk
2+
include ../default.mk
3+
4+
lisp: $(ELCS) loaddefs
5+
6+
loaddefs: $(PKG)-autoloads.el
7+
8+
%.elc: %.el
9+
@printf "Compiling $<\n"
10+
@$(EMACS) -Q --batch $(EMACS_ARGS) \
11+
$(LOAD_PATH) --funcall batch-byte-compile $<
12+
13+
CLEAN = $(ELCS) $(PKG)-autoloads.el
14+
15+
clean:
16+
@printf "Cleaning...\n"
17+
@rm -rf $(CLEAN)
18+
19+
define LOADDEFS_TMPL
20+
;;; $(PKG)-autoloads.el --- automatically extracted autoloads
21+
;;
22+
;;; Code:
23+
(add-to-list 'load-path (directory-file-name \
24+
(or (file-name-directory #$$) (car load-path))))
25+
26+
;; Local Variables:
27+
;; version-control: never
28+
;; no-byte-compile: t
29+
;; no-update-autoloads: t
30+
;; End:
31+
;;; $(PKG)-autoloads.el ends here
32+
endef
33+
export LOADDEFS_TMPL
34+
#'
35+
36+
$(PKG)-autoloads.el: $(ELS)
37+
@printf "Generating $@\n"
38+
@printf "%s" "$$LOADDEFS_TMPL" > $@
39+
@$(EMACS) -Q --batch --eval "(progn\
40+
(setq make-backup-files nil)\
41+
(setq vc-handled-backends nil)\
42+
(setq default-directory (file-truename default-directory))\
43+
(setq generated-autoload-file (expand-file-name \"$@\"))\
44+
(setq find-file-visit-truename t)\
45+
(update-directory-autoloads default-directory))"

lisp/forge-bitbucket.el

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
;;; forge-bitbucket.el --- bitbucket support -*- lexical-binding: t -*-
2+
3+
;; Copyright (C) 2018 Jonas Bernoulli
4+
5+
;; Author: Jonas Bernoulli <[email protected]>
6+
;; Maintainer: Jonas Bernoulli <[email protected]>
7+
8+
;; Magit is free software; you can redistribute it and/or modify it
9+
;; under the terms of the GNU General Public License as published by
10+
;; the Free Software Foundation; either version 3, or (at your option)
11+
;; any later version.
12+
;;
13+
;; Magit is distributed in the hope that it will be useful, but WITHOUT
14+
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15+
;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16+
;; License for more details.
17+
;;
18+
;; You should have received a copy of the GNU General Public License
19+
;; along with Magit. If not, see http://www.gnu.org/licenses.
20+
21+
;;; Code:
22+
23+
(require 'forge)
24+
25+
;;; Class
26+
27+
(defclass forge-bitbucket-repository (forge-repository)
28+
((issues-url-format :initform "https://%h/%o/%n/issues")
29+
(issue-url-format :initform "https://%h/%o/%n/issues/%i")
30+
;; The anchor for the issue itself is .../%i#issue-%i
31+
(issue-post-url-format :initform "https://%h/%o/%n/issues/%i#comment-%I")
32+
(pullreqs-url-format :initform "https://%h/%o/%n/pull-requests")
33+
(pullreq-url-format :initform "https://%h/%o/%n/pull-requests/%i")
34+
(pullreq-post-url-format :initform "https://%h/%o/%n/pull-requests/%i#comment-%I")
35+
(commit-url-format :initform "https://%h/%o/%n/commits/%r")
36+
(branch-url-format :initform "https://%h/%o/%n/branch/%r")
37+
(remote-url-format :initform "https://%h/%o/%n/src")
38+
(create-issue-url-format :initform "https://%h/%o/%n/issues/new")
39+
(create-pullreq-url-format :initform "https://%h/%o/%n/pull-requests/new")
40+
(pullreq-refspec :initform "+refs/pull-requests/*/from:refs/pullreqs/*")))
41+
42+
;;; _
43+
(provide 'forge-bitbucket)
44+
;;; forge-bitbucket.el ends here

0 commit comments

Comments
 (0)