{"thread":{"id":"2040","subject":"cg-mv","startedAt":"2005-10-07T14:33:33Z","lastAt":"2005-10-12T14:28:09Z","messageCount":4,"participants":["Zack Brown","Petr Baudis","Josef Weidendorfer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"9794","messageId":"20051007143333.GA18843@tumblerings.org","threadId":"2040","inReplyTo":null,"subject":"cg-mv","fromName":"Zack Brown","fromEmail":"zbrown@tumblerings.org","sentAt":"2005-10-07T14:33:33Z","receivedAt":"2005-10-07T14:33:33Z","isPatch":false,"sender":{"key":"zbrown@tumblerings.org","avatar":null},"body":"Hi,\n\nIIRC, file renaming is something we only care about at read time, we don't\nactually need to track it while making the change, because git allows us to\ntrack data from file to file without having to tell it that the data is moving.\n\nSo, just to keep certain people happy, why not have the cg-mv command defined to\nsomething like this:\n\n#!/bin/bash\ncp $1 $2\ncg-rm $1\ncg-add $2\n\n\nBe well,\nZack\n\n-- \nZack Brown\n"},{"id":"10008","messageId":"20051012100757.GM30889@pasky.or.cz","threadId":"2040","inReplyTo":"20051007143333.GA18843@tumblerings.org","subject":"Re: cg-mv","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-10-12T10:07:57Z","receivedAt":"2005-10-12T10:07:57Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Oct 07, 2005 at 04:33:33PM CEST, I got a letter\nwhere Zack Brown <zbrown@tumblerings.org> told me that...\n> Hi,\n\nHello,\n\n> IIRC, file renaming is something we only care about at read time, we don't\n> actually need to track it while making the change, because git allows us to\n> track data from file to file without having to tell it that the data is moving.\n> \n> So, just to keep certain people happy, why not have the cg-mv command defined to\n> something like this:\n> \n> #!/bin/bash\n> cp $1 $2\n> cg-rm $1\n> cg-add $2\n\nso it should keep the file under the original name as well, but\nuntraced? That's weird. What about\n\n\t#!/usr/bin/env bash\n\n\tif [ -e $2 ]; then\n\t\t! got_parameter -f && die \"dest exists\"\n\t\t[ -e $1 ] || die \"no source nor destination\"\n\tfi\n\t( [ -e $1 ] && mv $1 $2 ) && cg-add $2 && cg-rm $1\n\nplus quoting and stuff?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"10014","messageId":"200510121514.22276.Josef.Weidendorfer@gmx.de","threadId":"2040","inReplyTo":"20051012100757.GM30889@pasky.or.cz","subject":"Re: cg-mv","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2005-10-12T13:14:22Z","receivedAt":"2005-10-12T13:14:22Z","isPatch":false,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Wednesday 12 October 2005 12:07, Petr Baudis wrote:\n> so it should keep the file under the original name as well, but\n> untraced? That's weird. What about\n>\n> \t#!/usr/bin/env bash\n>\n> \tif [ -e $2 ]; then\n> \t\t! got_parameter -f && die \"dest exists\"\n> \t\t[ -e $1 ] || die \"no source nor destination\"\n> \tfi\n> \t( [ -e $1 ] && mv $1 $2 ) && cg-add $2 && cg-rm $1\n>\n> plus quoting and stuff?\n\nWishlist...\nPlease make it similar to mv:\n* Rename directories, too\n* If last argument is an existing directory\n  move given files/directories into that directory\n\nJosef\n"},{"id":"10021","messageId":"20051012142809.GA17037@tumblerings.org","threadId":"2040","inReplyTo":"20051012100757.GM30889@pasky.or.cz","subject":"Re: cg-mv]","fromName":"Zack Brown","fromEmail":"zbrown@tumblerings.org","sentAt":"2005-10-12T14:28:09Z","receivedAt":"2005-10-12T14:28:09Z","isPatch":false,"sender":{"key":"zbrown@tumblerings.org","avatar":null},"body":"On Wed, Oct 12, 2005 at 12:07:57PM +0200, Petr Baudis wrote:\n> Dear diary, on Fri, Oct 07, 2005 at 04:33:33PM CEST, I got a letter\n> where Zack Brown <zbrown@tumblerings.org> told me that...\n> > Hi,\n> \n> Hello,\n> \n> > IIRC, file renaming is something we only care about at read time, we don't\n> > actually need to track it while making the change, because git allows us to\n> > track data from file to file without having to tell it that the data is moving.\n> > \n> > So, just to keep certain people happy, why not have the cg-mv command defined to\n> > something like this:\n> > \n> > #!/bin/bash\n> > cp $1 $2\n> > cg-rm $1\n> > cg-add $2\n> \n> so it should keep the file under the original name as well, but\n> untraced? That's weird.\n\nYes, I mistyped. cp is wrong.\n\n> What about\n> \n> \t#!/usr/bin/env bash\n> \n> \tif [ -e $2 ]; then\n> \t\t! got_parameter -f && die \"dest exists\"\n> \t\t[ -e $1 ] || die \"no source nor destination\"\n> \tfi\n> \t( [ -e $1 ] && mv $1 $2 ) && cg-add $2 && cg-rm $1\n> \n> plus quoting and stuff?\n\nYes, that's nicer. Maybe the last line should be:\n\n( [ -e $1 ] && mv $1 $2 ) && cg-add $2 && cg-rm $1 || die \"unable to rename file\"\n\nBut you've already done \"-e $1\" earlier, right? So maybe you don't need it at\nthe end. Just have:\n\nmv $1 $2 && cg-add $2 && cg-rm $1 || die \"unable to rename file\"\n\nNo?\n\nBe well,\nZack\n\n> \n> -- \n> \t\t\t\tPetr \"Pasky\" Baudis\n> Stuff: http://pasky.or.cz/\n> VI has two modes: the one in which it beeps and the one in which\n> it doesn't.\n\n-- \nZack Brown\n"}]}