{"thread":{"id":"16933","subject":"RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]","startedAt":"2008-12-30T22:39:11Z","lastAt":"2008-12-31T02:22:32Z","messageCount":3,"participants":["Conor Rafferty","Boyd Stephen Smith Jr.","Sitaram Chamarty"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"99007","messageId":"BB5F02FD3789B54E8964D38D6775E718242D33@ALTMORE-SVR.altmore.local","threadId":"16933","inReplyTo":null,"subject":"RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]","fromName":"Conor Rafferty","fromEmail":"conor.rafferty@altmore.co.uk","sentAt":null,"receivedAt":"2008-12-30T22:39:11Z","isPatch":false,"sender":{"key":"conor.rafferty@altmore.co.uk","avatar":null},"body":"Whoa there Stevey, I'm a windows user, don't forget\n\nI mighta had a chance at following this 10-12 years ago when last I did\nsome scripting, but not now\n\nIts very generous of you to go to all this bother and I'm mighty\ngrateful. \n\nHowever if this is what its gonna take to get what I want, then Im'\noutta here.\n\nGetting a snapshot on the filesystem, in terms of a directory tree (not\na reference to, representation of etc etc. but a real life directory\ntree, files and folders that you can actually interact with - build,\nedit etc.), of a past version is a basic operation in my book.\nEven in clearcase this was a cinch.\n\nIs there anyone who can see anyway to do this simply, without a script,\nwithout creating a branch ?\n\nPersonally I suspect \"$ git checkout <version> .\" is what should be\ndoing this (I have confidence in saying this because it seems to want to\ndo this, and does it right at least half the time). But no-one wants to\nadmit to the remotest possibility that it might be off ....\n\nIn any case, a bunch of smart guys like you should be able to knock this\nfunctionality together in hours, if you put your mind to it.\n\nI know you guys have put a lot into this project and for many of you it\ndefines who you are \n- but if you want ppl out there in the user world to take this stuff on,\nits gotta work for them \n\n<END>impassioned plea</>\n\n-----Original Message-----\nFrom: Boyd Stephen Smith Jr. [mailto:bss@iguanasuicide.net] \nSent: 30 December 2008 22:17\nTo: Conor Rafferty\nCc: git@vger.kernel.org\nSubject: Re: for newbs = little exercise / tutorial / warmup for windows\nand other non-sophisticated new Git users :-) [Scanned]\n\nOn Tuesday 2008 December 30 15:49:22 Boyd Stephen Smith Jr. wrote:\n> On Tuesday 2008 December 30 15:27:33 you wrote:\n> > conorr@KINKLADZE /w/GITPLATFORM/swproj $ git status # On branch \n> > master nothing to commit (working directory clean)\n> >\n> > conorr@KINKLADZE /w/GITPLATFORM/swproj $ git checkout versionA .\n> >\n> > conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt  AC.txt\n> >\n> > conorr@KINKLADZE /w/GITPLATFORM/swproj $ rm *.*\n> >\n> > conorr@KINKLADZE /w/GITPLATFORM/swproj $ git checkout versionB .\n> >\n> > conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt  AC.txt  BC.txt\n>\n> Not a bug.  git checkout <commit> <paths> does not delete files by\ndesign.\n> Try using \"git checkout versionB\" instead (no paths specified), and it\n\n> will properly remove AC.txt from your working tree as well as warning \n> you that \"You're Doing It Wrong\" (tm).\n\nThis may be what you want:\n(commands)\nmkdir test && cd test && git init &&\n\necho 'ABC' > ABC.txt && echo 'AC' > AC.txt && echo 'BC' > BC.txt && echo\n'C' > C.txt &&\n\nfind -name '*C*' -print0 | xargs -r0 -- git add -- && git commit -m '\"C\"\nfiles.' && git branch versionC master &&\n\ngit checkout -b versionA master &&\nfind -type f -not -wholename '*.git*' -not -name '*A*' -print0 | \\\n\txargs -r0 -- git rm -- &&\ngit commit -m 'Removed non-\"A\" files.' &&\n\ngit checkout -b versionB &&\nfind -type f -not -wholename '*.git*' -not -name '*B*' -print0 | \\\n\txargs -r0 -- git rm -- &&\ngit commit -m 'Removed non-\"B\" files.' &&\n\ngit checkout -b versionD master &&\nfind -type f -not -wholename '*.git*' -not -name '*D*' -print0 | \\\n\txargs -r0 -- git rm -- && git commit -m 'Removed non-\"D\" files.'\n&&\n\ngit checkout master && git branch -v --abbrev=4 && ls -l && git checkout\nversionA && ls -l && git checkout versionB && ls -l && git checkout\nversionC && ls -l && git checkout versionD && ls -l\n\n(output)\n/home/bss/test\nInitialized empty Git repository in /home/bss/test/.git/ Created initial\ncommit 8dbf3a1: All files.\n 4 files changed, 4 insertions(+), 0 deletions(-)  create mode 100644\nABC.txt  create mode 100644 AC.txt  create mode 100644 BC.txt  create\nmode 100644 C.txt Switched to a new branch \"versionA\"\nrm 'BC.txt'\nrm 'C.txt'\nCreated commit a06e10c: Removed non-\"A\" files.\n 2 files changed, 0 insertions(+), 2 deletions(-)  delete mode 100644\nBC.txt  delete mode 100644 C.txt Switched to a new branch \"versionB\"\nrm 'AC.txt'\nCreated commit 2029ca2: Removed non-\"B\" files.\n 1 files changed, 0 insertions(+), 1 deletions(-)  delete mode 100644\nAC.txt Switched to a new branch \"versionD\"\nrm 'ABC.txt'\nrm 'AC.txt'\nrm 'BC.txt'\nrm 'C.txt'\nCreated commit 1793ba0: Removed non-\"D\" files.\n 4 files changed, 0 insertions(+), 4 deletions(-)  delete mode 100644\nABC.txt  delete mode 100644 AC.txt  delete mode 100644 BC.txt  delete\nmode 100644 C.txt Switched to branch \"master\"\n* master   8dbf \"C\" files.\n  versionA a06e Removed non-\"A\" files.\n  versionB 2029 Removed non-\"B\" files.\n  versionC 8dbf \"C\" files.\n  versionD 1793 Removed non-\"D\" files.\ntotal 16\n-rw-r--r-- 1 bss users 4 2008-12-30 16:10 ABC.txt\n-rw-r--r-- 1 bss users 3 2008-12-30 16:10 AC.txt\n-rw-r--r-- 1 bss users 3 2008-12-30 16:10 BC.txt\n-rw-r--r-- 1 bss users 2 2008-12-30 16:10 C.txt Switched to branch\n\"versionA\"\ntotal 8\n-rw-r--r-- 1 bss users 4 2008-12-30 16:10 ABC.txt\n-rw-r--r-- 1 bss users 3 2008-12-30 16:10 AC.txt Switched to branch\n\"versionB\"\ntotal 4\n-rw-r--r-- 1 bss users 4 2008-12-30 16:10 ABC.txt Switched to branch\n\"versionC\"\ntotal 16\n-rw-r--r-- 1 bss users 4 2008-12-30 16:10 ABC.txt\n-rw-r--r-- 1 bss users 3 2008-12-30 16:10 AC.txt\n-rw-r--r-- 1 bss users 3 2008-12-30 16:10 BC.txt\n-rw-r--r-- 1 bss users 2 2008-12-30 16:10 C.txt Switched to branch\n\"versionD\"\ntotal 0\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss@iguanasuicide.net                     ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.net/                      \\_/     \n"},{"id":"99018","messageId":"200812301812.12759.bss@iguanasuicide.net","threadId":"16933","inReplyTo":"BB5F02FD3789B54E8964D38D6775E718242D33@ALTMORE-SVR.altmore.local","subject":"Re: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss@iguanasuicide.net","sentAt":"2008-12-31T00:12:09Z","receivedAt":"2008-12-31T00:12:09Z","isPatch":false,"sender":{"key":"bss@iguanasuicide.net","avatar":"https://gravatar.com/avatar/84b95eeff194b816c1568b1339e63e4b229825298664a9037b9f1ec713ead1e3?d=mp&s=160"},"body":"On Tuesday 2008 December 30 16:55:38 Conor Rafferty wrote:\n> Whoa there Stevey, I'm a windows user, don't forget\n\nI just assumed you were also a git user. ;)\n\n> However if this is what its gonna take to get what I want, then Im'\n> outta here.\n\nYou aren't being entirely clear about what you want.\n\n> Getting a snapshot on the filesystem, in terms of a directory tree (not\n> a reference to, representation of etc etc. but a real life directory\n> tree, files and folders that you can actually interact with - build,\n> edit etc.), of a past version is a basic operation in my book.\n> Even in clearcase this was a cinch.\n\nWell, there's a lot of things about UNIX and Windows directories that git \ndoesn't store.  It'll restore the contents, sure, but not the permissions, \ntimestamps, etc.  However git also stores the *history*, if you don't care \nabout that, tarballs or zip archives might actually be a better system for \nyour purposes.\n\nBut, each time you commit you've made some snapshot (completeness depends on \nwhat you staged with git add and friends) and recorded that snapshot as \na \"later point in time\" from the last snapshot you \"git checkout\"ed.  That \nnew object (a \"commit\") can be identified by it's sha1.  It holds a sha1 of \nall it's parents (also \"commits\") and of the snapshot alone (a \"tree\").\n\nYou've also figured out how to use lightweight tags to give names (other than \ntheir sha1) to your commits.\n\n> Is there anyone who can see anyway to do this simply, without a script,\n> without creating a branch ?\n\nBranching is arguably easier than tagging, and probably what you want to do \ninstead.  Sure, branches are mutable, but unsigned tags are also fairly \nmutable.\n\n> Personally I suspect \"$ git checkout <version> .\" is what should be\n> doing this.\n\nI'm pretty sure what you want is \"git checkout <version>\" not \"git checkout \n<version> <paths>\".  They operate differently.  Modern git can checkout a \nlightweight tag, but it's going to warn you that it not what you want.\n\n> - but if you want ppl out there in the user world to take this stuff on,\n> its gotta work for them\n\nMaybe others do, but I don't really see git as an end-user tool.  It's a \ndeveloper tool and rightly demands a bit of RTFMing before using it \neffectively.\n\nWhat you seem to *really* want is a bunch of named trees without any \nrelationship between one another.  IMHO, git isn't really good at that (but \nonly because it demands to do more).  A directory full of tarballs / \nzip-archives and a couple of scripts you wrote yourself (extract.sh; \nname-and-save.sh) would probably be better.\n\nI admit that there seems to be quite a niche for some sort of trivially usable \nVCS, but it needs to be good at merging spreadsheets, compressed/binary XML, \npresentations/decks, and other things not-text, have a pretty GUI, and run \nsecurely over TCP/IP ports that no one is willing to block.  It will probably \nbe next to useless for doing what git was initially designed for (managing \nLinux kernel patches).\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss@iguanasuicide.net                     ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.net/                      \\_/     \n"},{"id":"99025","messageId":"slrnglllr8.kdq.sitaramc@sitaramc.homelinux.net","threadId":"16933","inReplyTo":"BB5F02FD3789B54E8964D38D6775E718242D33@ALTMORE-SVR.altmore.local","subject":"Re: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2008-12-31T02:22:32Z","receivedAt":"2008-12-31T02:22:32Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On 2008-12-30, Conor Rafferty <conor.rafferty@altmore.co.uk> wrote:\n\n[re-arranged some of the quotes; it's not in the same order\nas in your original email...]\n\n> Even in clearcase this was a cinch.\n\nHey there's no need to use swear words ;-)\n\n> Is there anyone who can see anyway to do this simply, without a script,\n> without creating a branch ?\n\nYou'll have to unlearn this resistance to creating branches.\nI've never used clearcase, but people tell me it is\nexpensive to create branches and/or merge them later --\nalmost a project in itself perhaps?\n\nIn git, however, creating a branch is as cheap as creating a\ntag, so why not go with the flow until you're a little more\nfamiliar with it?\n\n> Personally I suspect \"$ git checkout <version> .\" is what should be\n\nleave out the \".\" is all you needed to do.\n\n> doing this (I have confidence in saying this because it seems to want to\n> do this, and does it right at least half the time). But no-one wants to\n> admit to the remotest possibility that it might be off ....\n\nBecause it's not off :-)  You're using an unusual construct\nthat is not often used.  (I've done path checkout of one or\na few files, but not the whole \".\" ever).  So it took people\ntime to analyse what was happening -- such as suggesting you\nuse \"git ls-files -s\" to see what's in the index at each\nstage.\n\nMay I ask where you got the idea that \".\" is needed?  We\nneed to fix that source too ;-)\n\n> In any case, a bunch of smart guys like you should be able to knock this\n> functionality together in hours, if you put your mind to it.\n\n> I know you guys have put a lot into this project and for many of you it\n> defines who you are \n> - but if you want ppl out there in the user world to take this stuff on,\n> its gotta work for them \n\nWhile I applaud your efforts to try and understand\neverything in one long weekend, you'd have more fun if you\nspaced it out a bit :-)\n\nI'll also say that \"ppl out there in the user world\" will\nnot experiment the way you have -- they'll follow a basic\nset of commands that work.\n\nThey'll even (gasp!) use the GUI.  Believe me the GUIs are\npretty nice, though it won't let you checkout a tag (you can\ncheckout a branch, but not a tag -- because this gets you a\ndetached head which is a little too advanced for normal\nfolks I guess).\n\nIn other words, you're combining newbie and expert too\nfast...\n\nFinally, I heartily recommend reading the following article:\nhttp://thedailywtf.com/Articles/Happy_Merge_Day!.aspx\n\nIf the hints in the article are not enough for you to figure\nout this is about clearcase read the comments :-)\n"}]}