threads / discuss / 17519

Git vc-git.el versus Emacs vc-git.el versus Gits git.el

Subject: Git vc-git.el versus Emacs vc-git.el versus Gits git.el

## tl;dr

4 messages between Feb 3, 2009 and Feb 3, 2009.

replies: 3people: 3as markdown or json

Brent Goodrick· Feb 3, 2009, 03:31 UTC · lore
Hi,
I have some questions concerning the Emacs Git integration:
 1. What is the difference between git.el and vc-git.el in the
    git/contrib/emacs directory?
 2. There is a vc-git.el in the Emacs top-of-trunk sources, and
    another one in the git/contrib/emacs directory in the Git
    sources. Which one should I use?  If I should use the one in
    Emacs, then why is there one in the Git source tree?

Thanks, Brent

Alexandre Julliard· Feb 3, 2009, 10:34 UTC · re: Brent Goodrick · lore

Re: Git vc-git.el versus Emacs vc-git.el versus Gits git.el

Brent Goodrick <bgoodr@gmail.com> writes:
Show 6 quoted lines
> Hi,
>
> I have some questions concerning the Emacs Git integration:
>
>  1. What is the difference between git.el and vc-git.el in the
>     git/contrib/emacs directory?

vc-git.el is a backend for the Emacs VC mode, which supports the standard C-x v commands. The advantage is that you can use the same commands for all VCS.

git.el is a project-wide status manager equivalent to pcl-cvs, but specialized for git. Its advantage is that by not trying to be generic it can offer more git-specific functionality that isn't available with VC mode.

They are not exclusive, you can use both at the same time, depending on what operations you are doing.

>  2. There is a vc-git.el in the Emacs top-of-trunk sources, and
>     another one in the git/contrib/emacs directory in the Git
>     sources. Which one should I use?  If I should use the one in
>     Emacs, then why is there one in the Git source tree?

The most recent one is the one in the Emacs trunk, so you should use this if possible. The one in the Git tree is an older version that's no longer maintained, though it can still be useful if you are running an old Emacs version.

-- 
Alexandre Julliard
julliard@winehq.org
Brent Goodrick· Feb 3, 2009, 15:53 UTC · re: Alexandre Julliard · lore

Re: Git vc-git.el versus Emacs vc-git.el versus Gits git.el

Alexandre Julliard writes:
 > Brent Goodrick <bgoodr@gmail.com> writes:
 > 
 > > Hi,
 > >
 > > I have some questions concerning the Emacs Git integration:
 > >
 > >  1. What is the difference between git.el and vc-git.el in the
 > >     git/contrib/emacs directory?
 > 
 > vc-git.el is a backend for the Emacs VC mode, which supports the
 > standard C-x v commands. The advantage is that you can use the same
 > commands for all VCS.
 > 
 > git.el is a project-wide status manager equivalent to pcl-cvs, but
 > specialized for git. Its advantage is that by not trying to be generic
 > it can offer more git-specific functionality that isn't available with
 > VC mode.
 > 
 > They are not exclusive, you can use both at the same time, depending on
 > what operations you are doing.

Sounds reasonable. I plan on using both since they are compatible with each other.

 > 
 > >  2. There is a vc-git.el in the Emacs top-of-trunk sources, and
 > >     another one in the git/contrib/emacs directory in the Git
 > >     sources. Which one should I use?  If I should use the one in
 > >     Emacs, then why is there one in the Git source tree?
 > 
 > The most recent one is the one in the Emacs trunk, so you should use
 > this if possible. The one in the Git tree is an older version that's no
 > longer maintained, though it can still be useful if you are running an
 > old Emacs version.

Having the git.el and the vc-git.el file in the same git sources directory, git/contrib/emacs, fouls up standard `require' loading practice on Emacs 23 since Emacs 23 has vc-git.el in the load-path already. This is the way that I have hacked around it in my Emacs 23 setup, which also explains why:

	;; We can't use (add-to-list 'load-path git-emacs-lisp-dir) here because
	;; there is an older version of vc-git.el in that same directory, and we
	;; prefer the one that comes with Emacs 23:
	(load-file (expand-file-name "git.el" git-emacs-lisp-dir))

Since the vc-git.el is old, would it be feasible/desirable to rename git/contrib/emacs/vc-git.el to git/contrib/emacs/old/vc-git.el so as to allow older Emacs to continue to load the older version?

I would suppose that if/when git.el is moved into the Emacs sources, then the same renaming operation would be done for git.el, too.

Also, I could not find any section in the Git manual for git.el. Given that it is in the contrib directory, perhaps a separate manual file would be appropriate?

Thanks for your help! Brent

Junio C Hamano· Feb 3, 2009, 17:46 UTC · re: Alexandre Julliard · lore

Re: Git vc-git.el versus Emacs vc-git.el versus Gits git.el

Alexandre Julliard <julliard@winehq.org> writes:
Show 9 quoted lines
>>  2. There is a vc-git.el in the Emacs top-of-trunk sources, and
>>     another one in the git/contrib/emacs directory in the Git
>>     sources. Which one should I use?  If I should use the one in
>>     Emacs, then why is there one in the Git source tree?
>
> The most recent one is the one in the Emacs trunk, so you should use
> this if possible. The one in the Git tree is an older version that's no
> longer maintained, though it can still be useful if you are running an
> old Emacs version.
A patch to add contrib/emacs/README to hold this info would be nice.

← back to recent threads