[Linux-Biella] Differenze cvs e svn

Emanuele Aina em a nerd.ocracy.org
Lun 8 Ott 2007 19:10:26 CEST


Paolo Ciarrocchi riportò:

>> Sto riportando il tuo dubbio sulla ml di git.

Grande!

>> On Thu, Oct 04, 2007 at 02:27:41PM +0200, Paolo Ciarrocchi <paolo.ciarrocchi a gmail.com> wrote:
>>> Why do we have the option "--cached" and not "--index"?
>> according to glossary.txt, 'cache' is an obsolete for 'index'. probably
>> this is the reason
>>
>> probably cache.h will be never renamed to index.h, i don't know if diff
>> --cached will be ever renamed to diff --index
> 
> Probably never.
> 
> Some commands support both --index and --cached and have
> different meanings.  For them,
> 
>  * --index means work on both index and work tree;
>  * --cached means work only on index and ignore work tree.

--index significa index+wt
--cache significa index

Terribile. O quantomeno complicato. :(

> In the case of "diff --cached", the latter is exactly what's
> happening.  We do not say "git diff-index --index $commit"
> because "git diff-index" (and by extension, when you give only
> one commit to "git diff" as parameter) is all about a commit vs
> your uncommitted changes, so having you say "--index" is just
> silly.  "git diff --cached" is just a shorthand for "git diff
> --cached HEAD".  Because --cached would make sense to no other
> form of diff, its presense by definition means you are talking
> about the one-tree form of diff i.e. compare a commit with your
> uncommitted changes.

Non riesco a seguire.

"git diff-index $commit" è tra $commit e wt.

Visto che non tocca l'index, perché è in git-diff-INDEX?

"git diff-index --cached $commit" è tra $commit e index.

Che differenza c'è tra git-diff e git-diff-index?

Mi rifiuto categoricamente di trovare le sette piccole differenze nelle 
due enormi pagine di manuale... :)

> An example of a command that supports both is "git apply".
> Actually it is an extreme case in that it allows "no index" form
> of operation, so it has "git apply", "git apply --cached", and
> "git apply --index".  The --cached would only apply to index
> without touching work tree, the --index would apply to both
> index and work tree.

Boh.

Non so cosa dire se non che mi pare tutto complicato con l'aggravante 
che non riesco a vederne i benefici...

> Credo si debba aggiornare la documentazione.
> 
> Grazie per il commento comunque, molto utile!

Grazie a te per averlo accolto in modo costruttivo! ;)

-- 
Buongiorno.
Complimenti per l'ottima scelta.



Maggiori informazioni sulla lista Linux