~ubuntu-branches/debian/experimental/magithub/experimental

« back to all changes in this revision

Viewing changes to magithub-proxy.el

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2017-06-14 14:34:54 UTC
  • Revision ID: package-import@ubuntu.com-20170614143454-bnymlw3u1446h1p4
Tags: upstream-0.1.2+20170516.7fd7343
ImportĀ upstreamĀ versionĀ 0.1.2+20170516.7fd7343

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;;; magithub-proxy.el --- Fake repository context  -*- lexical-binding: t; -*-
 
2
 
 
3
;; Copyright (C) 2017  Sean Allred
 
4
 
 
5
;; Author: Sean Allred <code@seanallred.com>
 
6
;; Keywords: tools
 
7
 
 
8
;; This program is free software; you can redistribute it and/or modify
 
9
;; it under the terms of the GNU General Public License as published by
 
10
;; the Free Software Foundation, either version 3 of the License, or
 
11
;; (at your option) any later version.
 
12
 
 
13
;; This program is distributed in the hope that it will be useful,
 
14
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
;; GNU General Public License for more details.
 
17
 
 
18
;; You should have received a copy of the GNU General Public License
 
19
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
 
 
21
;;; Commentary:
 
22
 
 
23
;; Use a different repository context
 
24
 
 
25
;;; Code:
 
26
 
 
27
(require 'magit)
 
28
 
 
29
(defun magithub-proxy-set (remote)
 
30
  "Use REMOTE as the issue-tracker in this repository."
 
31
  (interactive (list (magit-read-remote "Issue-tracking remote")))
 
32
  (magit-set (unless (string= remote "origin") remote) "magithub" "proxy"))
 
33
 
 
34
(defun magithub-proxy-set-default (remote)
 
35
  "Use REMOTE as the default issue-tracker for all repositories.
 
36
If no issue-tracker is defined on a per-repo basis, this tracker is used.
 
37
 
 
38
This modifies global git-config."
 
39
  (interactive "sDefault remote name of issue-tracker (applies to all repositories): ")
 
40
  (and (magit-git-success "config" "--global" "magithub.proxy" remote)
 
41
       remote))
 
42
 
 
43
(provide 'magithub-proxy)
 
44
;;; magithub-proxy.el ends here