Re: [ANNOUNCE] Example Cogito Addon - cogito-bundle
- From
Jeff King <peff@peff.net>
- Date
- Oct 20, 2006, 22:59 UTC
- Message-ID
- <20061020225917.GA30584@coredump.intra.peff.net>
- In-Reply-To
- <20061020181210.GA29843@artax.karlin.mff.cuni.cz>
On Fri, Oct 20, 2006 at 08:12:10PM +0200, Jan Hudec wrote:
Show 8 quoted lines
> At this point, I expect the tree to look like this: > A$ ls -R > .: > data/ > data: > hello.txt > A$ cat data/hello.txt > Hello World!
Git does what you expect here.
Show 15 quoted lines
> A$ VCT mv data greetings > A$ VCT commit -m "Renamed the data directory to greetings" > B$ echo "Goodbye World!" > data/goodbye.txt > B$ VCT add data/goodbye.txt > B$ VCT commit -m "Added goodbye message." > A$ VCT merge B > > And now I expect to have tree looking like this: > > A$ ls -R > .: > greetings/ > greetings: > hello.txt > goodbye.txt
Git does not do what you expect here. It notes that files moved, but it does not have a concept of directories moving. Git could, even without file-ids or special patch types, figure out what happened by noting that every file in data/ was renamed to its analogue in greetings/, and infer that previously non-existant files in data/ should also be moved to greetings/.
However, I'm not sure that I personally would prefer that behavior. In some cases you might actually WANT data/goodbye.txt, and in some other cases a conflict might be more appropriate. In any case, I would rather the SCM do the simple and predictable thing (which I consider to be creating data/goodbye.txt) rather than be clever and wrong (even if it's only wrong a small percentage of the time).
In short, git doesn't do what you expect, but I'm not convinced that it's a bug or lack of feature, and not simply a difference in desired behavior.
-Peff