Re: How to enable file status icons for Git?
<klaus.berndl <at> capgemini-sdm.com>
2009-04-06 11:16:45 GMT
Well, let me recapitulate:
If you have a directory-tree <top-most-directory> version-managed by Git then only
<top-most-directory> has a subdir .git but all other subdirs containing git-managed sourc-files not, right?
If yes, then the mechanism needed by ecb-vc-dir-managed-by-GIT is obvious:
1. check if vc-git is available (locate-library ...)
2. Check for .git subdir in the called directory
2.1. If yes, return 'GIT
2.2. If no then check if we are already in the root-dir:
2.2.1 If yes, return nil because then the called dir is not git-managed
2.2.2 If no then go one parent-dir upward and run ecb-vc-dir-managed-by-GIT with that parent-dir recursively
Do not bother with performance-issues with this test, because ECB caches the checked value after first time...
Tell me if you are unable to program this with elisp - then i will see if i can do it for you...
Klaus
-----Ursprüngliche Nachricht-----
Von: Houman Dunnil [mailto:h.dunnil <at> gmail.com]
Gesendet: Montag, 6. April 2009 12:31
An: Berndl, Klaus
Cc: ecb-list <at> lists.sourceforge.net
Betreff: Re: [ECB-list] How to enable file status icons for Git?
Awesome! Thanks a lot! It works! Well, partially...
I've added (ecb-vc-dir-managed-by-GIT . ecb-vc-state) to `ecb-vc-supported-backends'
And defined the following method:
(defun ecb-vc-dir-managed-by-GIT (directory)
"Return 'GIT if DIRECTORY is managed by GIT. nil if not."
(and (ecb-file-exists-p (concat directory "/.git/"))
(locate-library "vc-git")
'GIT))
With these additions it shows status icons for the files that are in the root directory of the Git working
directory but not for the files that are in sub-directories. I think it's because that Git has only has one
.git directory in the root, unlike SVN which has a .svn dir in each directory.
Unfortunately, I'm not a lisp pro and don't know how to tell ecb-vc-dir-managed-by-GIT to process
sub-directories. Any clue?
On Mon, Apr 6, 2009 at 2:13 PM, <klaus.berndl <at> capgemini-sdm.com> wrote:
> Ok, now i know it better
>
> It should be not hard to get Git working with ECB:
>
> 1. Check the option `ecb-vc-supported-backends' - read the docstring
> and check for example the SVN-stuff: ecb-vc-dir-managed-by-SVN and
> ecb-vc-state...
> 2. maybe you have to ajust the option `ecb-vc-state-mapping' too but i
> suppose this is not necessary.
>
> So IMHO you have to do the following things:
> 1. Write a new function ecb-vc-dir-managed-by-GIT (and use
> ecb-vc-dir-managed-by-SVN as a starting example) 2. Add the
> combination of ecb-vc-dir-managed-by-GIT and ecb-vc-state to the
> option `ecb-vc-supported-backends'
>
> and Bob will be your uncle
>
> It it works then please send me your code then it will add this new
> backend to the next ECB-release...
>
> Does this help?
> Klaus
> ________________________________
> Von: klaus.berndl <at> capgemini-sdm.com
> [mailto:klaus.berndl <at> capgemini-sdm.com]
> Gesendet: Sonntag, 5. April 2009 19:45
> An: h.dunnil <at> gmail.com; ecb-list <at> lists.sourceforge.net
> Betreff: Re: [ECB-list] How to enable file status icons for Git?
>
> Hi,
>
> first of all: what the hell is Git? sorry for a probably dump question...
>
>
> Then: I supose the git is another versioning system...but: are you
> sure it is supported out-of-the-box by vc of Emacs... If no, then it
> is also no supported by ECB ... of course you can customize ECB so it
> supports git even when not supported by vc (e.g. clearcase is also
> supported by ECB) but for this i must take a look into the related options of ECB.....
>
> So, please first tell me something about Git - s.a.
>
> Klaus
>
> _________________________________________________________Klaus Berndl
> / Capgemini sd&m / München Business Development Manager / Bereich BankenTel:
> +49 89 63812 392 / Fax: +49 89 63812 220 / www.de.capgemini-sdm.comMobil:
> +49 162 2842 051 / klaus.berndl <at> capgemini-sdm.comCapgemini sd&m AG,
> Carl-Wery-Str. 42, 81739 München Zusammen. Für nachhaltigen
> Erfolg._________________________________________________________Vorstand:
> Edmund Küpper (Vorsitzender), Burkhard Kehrbusch, Rüdiger Azone,Dr.
> Uwe Dumslaff, Kai Grambow, Dr. Michael Rading, Josef
> RannerAufsichtsrat: Pierre Hessler (Vorsitzender)Sitz und Amtsgericht:
> München HRB 126057
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Houman Dunnil [mailto:h.dunnil <at> gmail.com]
> Gesendet: So 05.04.2009 14:53
> An: ecb-list <at> lists.sourceforge.net
> Betreff: [ECB-list] How to enable file status icons for Git?
>
> Hi folks,
>
> I have installed the ECB and it works like a charm. The only thing
> that I cannot figure out is to enable status icons for Git files, it
> works fine for Subversion but I don't see any icon for Git files. What
> should I do in order to get them enabled?
>
> Thanks in advance,
>
> ----------------------------------------------------------------------
> -------- _______________________________________________
> Ecb-list mailing list
> Ecb-list <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecb-list
>
>
------------------------------------------------------------------------------