Re: git ls-files handles paths differently in Windows and Mac (probably Linux)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



12.10.2010, в 19:25, Alex Riesen написал(а):
> 
> Besides, if you have to just check if the tree under a path is changed
> you can always use
> --exit-code or --quiet to "git diff", it will speed them up.

Unfortunately, that's not enough: I have to know which files have changed and how (created, deleted, modified).
Also I feel that it's not the size of the output which is slow - the scan of directories itself is. 


>> And also "git diff --name-status" doesn't show unversioned files.
>> As I've found, "git ls-files" is the only command which shows unversioned files (except git status), isn't it?
> 
> Yes, you're right. What are you trying to do, BTW?

I'm developing a plugin for Git integration for IntelliJ IDEA (an IDE for Java and other languages).
And the task I'm working now is to get the status of index and working tree. I want to make it as fast as possible.
To work with a Git repository I start a process with git native commands, so every command to execute is additional cost.
(Maybe I could work with the filesystem and raw Git repository, but it would be an overhead).

If we forget about "git status --porcelain" there is no single command to get the whole status. I could use 
"git ls-files -ov" for unversioned files + "git diff --name-status" for all other.
OR 
"git ls-files -douvm" for the changes in the working tree + "git diff-index --cached" for the changes in the index.
OR
"git ls-files -ov" for unversioned + "git diff-files" for other files in the working tree + "git diff-index --cached" for the changes in the index.
or maybe something else

I've made a script which executes these commands (which allow to get the total status) on a large repository many times. 
My results show that "ls-files -douvm"+"git diff-index --cached" is the fastest combination.

Do you think I could achieve the same result in a simpler or faster way?

Thanks a lot.

----------------------------------
Kirill Likhodedov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]