Giter Site home page Giter Site logo

orgit's Introduction

A Git Porcelain inside Emacs

homepage | manual | faq | wiki | mastodon


Magit is an interface to the version control system Git, implemented as an Emacs package. Magit aspires to be a complete Git porcelain. While we cannot (yet) claim that Magit wraps and improves upon each and every Git command, it is complete enough to allow even experienced Git users to perform almost all of their daily version control tasks directly from within Emacs. While many fine Git clients exist, only Magit and Git itself deserve to be called porcelains.


Keeping its users this excited is a lot of work . If Magit makes you
more productive too, then please consider making a donation.
Thank you! — Jonas Bernoulli

Sponsor my work using Github Sponsors    Sponsor my work using Liberapay
Sponsor my work using Opencollective    Sponsor my work using PayPal

Some alternative donation methods are available.

Getting Started

If you are new to Magit, then either one of the following two articles should help understanding how it differs from other Git clients.

If you are completely new to Magit, then this article is a good visual introduction.

Almost everything that you see in Magit can be acted on by pressing some key, but that's not obvious from just seeing how Magit looks. The screenshots and accompanying text of this article explain how to perform a variety of actions on Magit's output.

Magit differs significantly from other Git interfaces, and its advantages are not immediately obvious simply from looking at a few screenshots as presented in the preceding article.

This article discusses Magit's properties in somewhat more abstract terms.

Video introductions

If you prefer video introductions, head over to that page, where find a collection of such introductions and other videos about Magit, by various creators.


Support and Contributing

Magit has many users and very few maintainers, so we kindly ask to read the appropriate guidelines before getting in contact. — Thanks!

TL;DR We now use discussions for feature requests (not issues) and prefer if you ask the community for support instead of the overworked maintainers.

Please also consider to contribute by supporting other users or by making a monetary donation. — Thanks!


Acknowledgments

Magit was started by Marius Vollmer, and is now maintained by Jonas Bernoulli and Kyle Meyer. Former maintainers are Nicolas Dudebout, Noam Postavsky, Peter J. Weisberg, Phil Jackson, Rémi Vanicat and Yann Hodique. Many more people have contributed code, suggested features or made monetary contributions.

Thanks to all of you, may (the history of) the source be with you!


Compile Test Manual NonGNU ELPA Melpa Melpa Stable

orgit's People

Contributors

danielf-amobee avatar hlissner avatar kyleam avatar malabarba avatar tarsius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

orgit's Issues

Cannot store any link with recent org

Any attempt to store a link result in an error, with the following message: orgit-rev-store-1: Symbol’s function definition is void: org-link-store-props.

Relevant package versions:
org: 20190715
org-plus-contrib: 20190715
orgit: 20190630.1351
magit: 20190630.1351

Store line number in orgit-rev

I'd like to record notes to specific lines of a commit, not just the commit itself. Is there already a way to achieve this?

Note: I don't mean a specific line in a file changed by a commit, but the line of the diff as displayed by magit-revision.

Having the 1st commit message line in the orgit-rev link

The convention for commit messages is having a 1st line which describes the issue in short. I would like to suggest the option of having this short description as part of the orgit-rev link description.

One can introduce this with on/off toggle, or perhaps by specifying a format like orgit-topic-description-format where users can choose what to appear in the description.

The goal is improved readability, knowing what the commit is about without following it.

Can contribute code myself.

Thanks!

Option to store commit hash insteaf of ref

I see there is #13 and yet it does not work for me.
In

(defun orgit-rev-store-1 (rev)
  (let ((repo (abbreviate-file-name default-directory)))
    (unless (magit-ref-p rev)
      (setq rev (cond (current-prefix-arg      (magit-get-shortname rev))
                      (orgit-abbreviate-hashes (magit-rev-abbrev rev))
                      (t                       (magit-rev-parse rev)))))
    (org-store-link-props
     :type        "orgit-rev"
     :link        (format "orgit-rev:%s::%s" repo rev)
     :description (format "%s (magit-rev %s)" repo rev))))

the first (magit-ref-p rev) is non-nil if I try to store the link on master. Thus the link will be
/path/ (magit-rev master).

I'd like to get the commit hash instead of "master".

Better git link support

org-git-link can read git links of type git:::SHA1::linenum . But it won't create one like that. It also can't create a git link from a buffer created using magit-show . Ie, i use magit-blame, visit the file from the blame buffer and want to use org-store-link there. We would need a better integration with git to do that. Can we get orgit to create git links from buffers created via magit-blame?

Symbol’s function definition is void: orgit-link-set-parameters

When trying to use the latest version of this package (20161104.1823) I get the following error:

Compiling file /home/gsnewmark/.emacs.d/elpa/orgit-20161104.1823/orgit.el at Sat Nov  5 14:25:17 2016
Entering directory ‘/home/gsnewmark/.emacs.d/elpa/orgit-20161104.1823/’

Compiling no file at Sat Nov  5 14:25:17 2016
Error (bytecomp): Symbol’s function definition is void: orgit-link-set-parameters

Emacs version is "GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.9) of 2016-09-18".

The same error is reproduced when I try to manually byte-compile from source:

orgit.el:66:1:Error: Symbol’s function definition is void: orgit-link-set-parameters

Support forge

Would be nice if I could store a link to a PR/issue/comment/etc.

orgit causes org-export to fail

I'm using the latest HEAD from the master branch.

With the following orbit link in an org mode file:

[[orgit:~/html/eeremultimedia/solar][www.eeremultimedia.energy.gov/solar]]

When I do org-export to html, I get this error:

if: Cannot determine public remote for ~/html/eeremultimedia/solar

This causes my export to HTML to fail. Is there any work-around to this bug or some config setting that would solve this problem?

Add hook to automatically create orgit link to last commit after a commit

My usual workflow is to

  • clock-in a org task
  • do the work
  • commit

That's probably the same for most, but then I also want a NOTE to this commit in my TODO so I have to do as well:

  • open the last commit in magit
  • Copy the orgit link
  • Goto my clocked in task and make the note with a link

So I want to automate the above 3 steps.
Maybe just an option to auto-copy the orglink to the clipboard after a commit is enough,
or maybe some way to always add a note to the current clocked-in task.

I asked the same on gitter where @tarsius said:

You could add a function to git-commit-setup-hook which in turn adds a function
which does the actual work to with-editor-post-finish-hook. If you cannot piece
it together based on that, then feel free to open a feature request in the orgit
repository

I had a hard time getting the last commit id, so here I am ;)

Opening link from outside repository

I fear this is the wrong place to ask, but is there any way to open the links from a file outside the repository that is being linked to?

I have a global todo list, where I have different TODOS for different projects listed, can I insert a org-log link, e.g, [[orgit-log:~/repos/konfig/::("master")]], and have it open correctly when I use C-c C-o?

Make orgit save and rexecute git command

While storing a particular commit is great. It would be even nicer if we can store a git grep command (i.e. grep for author or a string in commit mesage) and later be rexecuted, don't you think? So, we don't have to rename a grep buffer when we want to search for another author or a string, and to re-execute, it's as simple as pressing C-c C-o.

org-add-link-type is an obsolete function as of Org 9.0

orgit.el:135:2:Warning: `org-add-link-type' is an obsolete function (as of Org
    9.0); use `org-link-set-parameters' instead.
orgit.el:159:2:Warning: `org-add-link-type' is an obsolete function (as of Org
    9.0); use `org-link-set-parameters' instead.
orgit.el:187:2:Warning: `org-add-link-type' is an obsolete function (as of Org
    9.0); use `org-link-set-parameters' instead.

What about the other direction: magit linking to locations in org-mode files?

This may be out of scope, but if you have an idea or know where it should go I'll be happy to send it the correct way (or figure it out myself if I have a hint)...

When you hit RET for magit-visit-item in a diff of an org-mode file, you don't visit the line described by the diff; instead you visit the collapsed heading. There's an org-reveal for this purpose, I think, but I can't figure out how to hook it to make it work.

Thanks!

store link to individual commit when in log?

When I'm in the log (e.g. after doing ll) and the buffer is e.g.

  deadbee * master origin/master origin/HEAD Revert "use the new database column"
[]badabee * use the new database column
  3141593 * implement frobnication

and I do C-c l / org-store-link, will store orgit-log:~/src/project/::master. Would it be possible to instead get the commit under point, e.g. orgit-rev:~/src/project/::badabee?

orgit is listed as an incompatible package in MELPA

orgit is listed as an incompatible package in MELPA because of the org version requirement, so it can't be installed. It seems like most packages don't specify an org version, and the ones that do end up listed as incompatible for some reason.

screen shot 2016-07-08 at 7 40 12 am

relative directory?

How would I store a relative directory? I'm linking to a revision from an org-file within the same repo; the repo may be stored in different places, but it seems like orgit-open wants to set default-directory no matter what the path is.

I tried "." or empty string, but that seemed to go to "~".

orgit-export fails if path is missing trailing '/'

orgit version: 20160801.715 from ELPA

With org.remote set in my git config, [[orgit:~/foo][foo]] yields the following error:

orgit-export: Cannot determine public remote for ~/foo

Whereas [[orgit:~/foo/][foo]] exports as expected.

Option to store full sha

I am very happy with storing links to commits and using them from within emacs.
I can also export to html and get links to the commit. But unfortunately, I need to specify the full sha in the rev (I have to use TFS).

Note. I did the following in my git repository:

git config orgit.rev http://server/nice/path/_git/repository/commit/%r

I get then in html:

<a href="http://server/nice/path/_git/repository/commit/00f5fcde9">repo-path/ (magit-rev 00f5fcde9)</a>

But I need:

<a href="http://server/nice/path/_git/repository/commit/00f5fcde9db2bbf4b18b1ff20c486a5b68bdd1ea">repo-path/ (magit-rev 00f5fcde9)</a>

Functions should be autoloaded

The autoloaded eval-after-load functions in this library modify org-store-link-functions, but the functions which this library adds to that hook are not themselves autoloaded. This means that a user who has installed this package, but not added an explicit require to their configuration, will get "function not defined" errors when org tries to call these functions.

I think at least the orgit-*-store functions must be autoloaded. Probably the -open and -export ones ought to be as well.

Add links to files at a revision

What I'm looking for is I think what the removed org-git-link library would do. It's very common for me to want to reference a specific line in documentation, which of course becomes fragile if I don't refer to the specific commit like this, for instance.

Playing around with magit-find-file appears to provide a lot of what is needed, but I'm new to elisp and strugging to get a start on how to add this myself.

Provide option to link to commits by commit message rather than hash

Here is a very common workflow for me:

  • I write some code on a feature branch, or on a machine-specific branch (for my local configuration files, for example).
  • Later on, I might need to amend the commit I made.
  • At some point, I might cherry-pick that commit onto my master or main branch.

When I'm working on some code, I'd like to log my progress in Org mode by referencing some commits. However, using the commit hash for this is fragile with regard to amend and cherry-pick. I'd like to instead have the option of referencing the commit via its commit message.

Fortunately, Git already has this support - this is the background behind my PR to magit magit/magit#4662.

I'd like to add an option to the orgit-store-rev command to support generating links that link to commit messages. Prefix argument or configuration option (perhaps generalizing orgit-store-reference past a boolean variable) would be fine by me.

orgit stores a link to the branch instead of to the commit for the latest commit

Hi,

Thanks for the great package.

I found that when I store a link to a commit, if the commit is the latest one (the tip of the branch), orgit stores a link to the branch (like (magit rev feature/branch)) instead of the one to the commit (like (magit rev a9ad864). For previous commits, orgit correctly stores the link to the commit.

Would it be possible to change the behavior so it stores the link to the commit?

Thank you very much!

FR: link to issues/PRs via Forge

I might have missed something but it looks like it is not currently possible to link to issues or PRs via Forge, and I thought it would be cool if it was ;-)

Resolve repo location dynamically

When collaborating with several people on an Org file, it would be nice if the orgit links would work across different setups. In particular, the repository locations may vary, which would break the links (and relative links can be restrictive).

I can think of the following options:

  • Only store the name of the root directory. When opening the link, look up the directory in a dedicated orgit-path variable. First match is taken.

Example: (setq orgit-path '("~/common-lisp" "~/source" "~/projects")). Then if link is
orgit-rev:project-foo::master and there is a ~/source/foo folder, org-rev-open knows that this is the directory of the repository.

  • Same as above with the path variable, but instead of looking up a directory name (which could vary across configurations), look up something that could identify the repo uniquely in all the folders found in orgit-path. For example, we could look the remote URL.

Better: make this a customizable function so that the users can choose how to lookup repositories.

Thoughts?

`orgit-*-complete-link` doesn't respect `orgit-store-repository-id`

At the moment if we have orgit-store-repository-id set to true and try to insert an orgit link (eg: org-insert-link-global) you complete to a repository in your magit-repository-directories but orgit still inserts an absolute link even though it should be relative.

org-store-link respects orgit-store-repository-id so other completion commands in orgit should as well.

Link to a commit

Hi,
is it possible to make a link to a certain commit (cannot see it in the readme).

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.