git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]
@ 2008-12-31  2:27 Conor Rafferty
  2008-12-31  2:35 ` Jeff Whiteside
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Conor Rafferty @ 2008-12-31  2:27 UTC (permalink / raw)
  To: Jeff Whiteside, Daniel Barkalow; +Cc: Boyd Stephen Smith Jr., git

 

-----Original Message-----
wtf is wrong with

git checkout <something>

??

** It doesn't reliably put the files that were in that revision into the
working directory - a fairly major flaw, for what I'm using SCM for (and
80% of the market IMHO)

if you must have

git checkout <something> <paths>

then instead use

git checkout <something> <paths>
git clean

** hmm, might try this - obviously as per Daniels post there is some
undefined interaction happenign with the index, to screw up the working
directory. I presume clean flushes the index?

but you will lose other files that aren't part of the repo but are still
in the project's dir (i.e. untracked files).

** don't care, I'll be removing them from working dir anyhow before
doing a rollback

On Tue, Dec 30, 2008 at 4:15 PM, Daniel Barkalow <barkalow@iabervon.org>
wrote:
> On Tue, 30 Dec 2008, Conor Rafferty wrote:
>
>> I don't understand, sorry. I thought I'd already removed all files 
>> from the local tree, in the $ rm *.* move just above the checkout
>
> That removes them from the filesystem, but they're still in the index.

> And "git checkout <something> ." first gets everything that *is* in 
> "." in <something> into the index, and then gets everything from "." 
> in the index into the filesystem.
>
> I suppose it is questionable as to whether it ought to copy paths that

> aren't in versionA from the index into the filesystem.
>
> To see this in a bit more detail, do:
>
> $ rm *.*
> $ git status
> (notice that the deletes are in the "won't be committed" section)
>
> Now, "git checkout <path>" will discard any changes in the "won't be 
> committed" section for that path. Maybe "git checkout versionA <path>"
> should only discard changes that are in the "won't be committed" 
> section for filenames that match that path and are in versionA (or are
> *different* in versionA and not removed?), but I think it's an area 
> where, if you're expecting any particular behavior out of that 
> command, you're likely to be surprised in some way in some situation.
>
>        -Daniel
> *This .sig left intentionally blank*
> --
> To unsubscribe from this list: send the line "unsubscribe git" in the 
> body of a message to majordomo@vger.kernel.org More majordomo info at

> http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 27+ messages in thread
* RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]
@ 2008-12-31 11:10 Conor Rafferty
  2008-12-31 16:00 ` Daniel Barkalow
  0 siblings, 1 reply; 27+ messages in thread
From: Conor Rafferty @ 2008-12-31 11:10 UTC (permalink / raw)
  To: Boyd Stephen Smith Jr.; +Cc: Jeff Whiteside, Daniel Barkalow, git


And you would be wrong, IMHO.  Many people have untracked files or
directories in their working directory ('cause they are working there)
that they don't want deleted willy-nilly.  Build files, modifications
that should be on a different branch, etc.  There's another thread
active on the list complaining that git removes too much from the
working tree.

** An SCM should be able to cope with both use cases. In fact I make it
easy for the SCM by deleting EVERYTHING from the working directory,
before calling git-checkout.

Most users of SCMs do make active modifications to the files in the SCM.
It's not a system only for archiving static projects.

** Archiving static projects is not the ONLY thing I want to do with my
SCM, it just happens to be the FIRST thing.

^ permalink raw reply	[flat|nested] 27+ messages in thread
* RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]
@ 2008-12-31 10:59 Conor Rafferty
  0 siblings, 0 replies; 27+ messages in thread
From: Conor Rafferty @ 2008-12-31 10:59 UTC (permalink / raw)
  To: Jeff Whiteside; +Cc: Daniel Barkalow, Boyd Stephen Smith Jr., git

Haha, no probs

Neither does the job

I either need to figure out how the indexes get involved in the dot
version,
Or give in and create a branch - that's how you guys work mainly, so
that use case will no doubt work 
Or find something else to do the job - mercurial looks promising

-----Original Message-----
From: Jeff Whiteside [mailto:jeff.m.whiteside@gmail.com] 
Sent: 31 December 2008 02:36
To: Conor Rafferty
Cc: Daniel Barkalow; Boyd Stephen Smith Jr.; git@vger.kernel.org
Subject: Re: for newbs = little exercise / tutorial / warmup for windows
and other non-sophisticated new Git users :-) [Scanned]

sir, i believe you're not reading what is typed.

> wtf is wrong with
>
> git checkout <something>
>
> ??
>
> ** It doesn't reliably put the files that were in that revision into 
> the working directory - a fairly major flaw, for what I'm using SCM 
> for (and 80% of the market IMHO)

yes it does.  your example uses "git checkout versionB .", which is NOT
"git checkout <something>"
we are suggesting you do "git checkout versionB" which is different
(HINT: there is NO dot), and which i'm 99% positive will work.

if you still disagree, then i'm sure mercurial will be sufficient for
your needs, and all your dcvs book-lernin' over christmas will be
transferrable.

good luck with whatever option you choose.

^ permalink raw reply	[flat|nested] 27+ messages in thread
* RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]
@ 2008-12-31  2:30 Conor Rafferty
  2008-12-31  3:40 ` Boyd Stephen Smith Jr.
  0 siblings, 1 reply; 27+ messages in thread
From: Conor Rafferty @ 2008-12-31  2:30 UTC (permalink / raw)
  To: Jeff Whiteside, Daniel Barkalow; +Cc: Boyd Stephen Smith Jr., git

MERCURIAL:

Update
hg update [-C] [-d DATE] [[-r] REV] 

Update the repository's working directory (the "working copy") to the
specified revision of the repository or to the tip revision of the
current (named) branch if no revision is specified.  

> I'm not looking for much....

-----Original Message-----
From: Jeff Whiteside [mailto:jeff.m.whiteside@gmail.com] 
Sent: 31 December 2008 02:22
To: Daniel Barkalow
Cc: Conor Rafferty; Boyd Stephen Smith Jr.; git@vger.kernel.org
Subject: Re: for newbs = little exercise / tutorial / warmup for windows
and other non-sophisticated new Git users :-) [Scanned]

wtf is wrong with

git checkout <something>

??

if you must have

git checkout <something> <paths>

then instead use

git checkout <something> <paths>
git clean

but you will lose other files that aren't part of the repo but are still
in the project's dir (i.e. untracked files).

On Tue, Dec 30, 2008 at 4:15 PM, Daniel Barkalow <barkalow@iabervon.org>
wrote:
> On Tue, 30 Dec 2008, Conor Rafferty wrote:
>
>> I don't understand, sorry. I thought I'd already removed all files 
>> from the local tree, in the $ rm *.* move just above the checkout
>
> That removes them from the filesystem, but they're still in the index.

> And "git checkout <something> ." first gets everything that *is* in 
> "." in <something> into the index, and then gets everything from "." 
> in the index into the filesystem.
>
> I suppose it is questionable as to whether it ought to copy paths that

> aren't in versionA from the index into the filesystem.
>
> To see this in a bit more detail, do:
>
> $ rm *.*
> $ git status
> (notice that the deletes are in the "won't be committed" section)
>
> Now, "git checkout <path>" will discard any changes in the "won't be 
> committed" section for that path. Maybe "git checkout versionA <path>"
> should only discard changes that are in the "won't be committed" 
> section for filenames that match that path and are in versionA (or are
> *different* in versionA and not removed?), but I think it's an area 
> where, if you're expecting any particular behavior out of that 
> command, you're likely to be surprised in some way in some situation.
>
>        -Daniel
> *This .sig left intentionally blank*
> --
> To unsubscribe from this list: send the line "unsubscribe git" in the 
> body of a message to majordomo@vger.kernel.org More majordomo info at

> http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 27+ messages in thread
* RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]
@ 2008-12-30 22:55 Conor Rafferty
  2008-12-31  0:12 ` Boyd Stephen Smith Jr.
  2008-12-31  2:22 ` Sitaram Chamarty
  0 siblings, 2 replies; 27+ messages in thread
From: Conor Rafferty @ 2008-12-30 22:55 UTC (permalink / raw)
  To: Boyd Stephen Smith Jr.; +Cc: git

Whoa there Stevey, I'm a windows user, don't forget

I mighta had a chance at following this 10-12 years ago when last I did
some scripting, but not now

Its very generous of you to go to all this bother and I'm mighty
grateful. 

However if this is what its gonna take to get what I want, then Im'
outta here.

Getting a snapshot on the filesystem, in terms of a directory tree (not
a reference to, representation of etc etc. but a real life directory
tree, files and folders that you can actually interact with - build,
edit etc.), of a past version is a basic operation in my book.
Even in clearcase this was a cinch.

Is there anyone who can see anyway to do this simply, without a script,
without creating a branch ?

Personally I suspect "$ git checkout <version> ." is what should be
doing this (I have confidence in saying this because it seems to want to
do this, and does it right at least half the time). But no-one wants to
admit to the remotest possibility that it might be off ....

In any case, a bunch of smart guys like you should be able to knock this
functionality together in hours, if you put your mind to it.

I know you guys have put a lot into this project and for many of you it
defines who you are 
- but if you want ppl out there in the user world to take this stuff on,
its gotta work for them 

<END>impassioned plea</>

-----Original Message-----
From: Boyd Stephen Smith Jr. [mailto:bss@iguanasuicide.net] 
Sent: 30 December 2008 22:17
To: Conor Rafferty
Cc: git@vger.kernel.org
Subject: Re: for newbs = little exercise / tutorial / warmup for windows
and other non-sophisticated new Git users :-) [Scanned]

On Tuesday 2008 December 30 15:49:22 Boyd Stephen Smith Jr. wrote:
> On Tuesday 2008 December 30 15:27:33 you wrote:
> > conorr@KINKLADZE /w/GITPLATFORM/swproj $ git status # On branch 
> > master nothing to commit (working directory clean)
> >
> > conorr@KINKLADZE /w/GITPLATFORM/swproj $ git checkout versionA .
> >
> > conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt  AC.txt
> >
> > conorr@KINKLADZE /w/GITPLATFORM/swproj $ rm *.*
> >
> > conorr@KINKLADZE /w/GITPLATFORM/swproj $ git checkout versionB .
> >
> > conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt  AC.txt  BC.txt
>
> Not a bug.  git checkout <commit> <paths> does not delete files by
design.
> Try using "git checkout versionB" instead (no paths specified), and it

> will properly remove AC.txt from your working tree as well as warning 
> you that "You're Doing It Wrong" (tm).

This may be what you want:
(commands)
mkdir test && cd test && git init &&

echo 'ABC' > ABC.txt && echo 'AC' > AC.txt && echo 'BC' > BC.txt && echo
'C' > C.txt &&

find -name '*C*' -print0 | xargs -r0 -- git add -- && git commit -m '"C"
files.' && git branch versionC master &&

git checkout -b versionA master &&
find -type f -not -wholename '*.git*' -not -name '*A*' -print0 | \
	xargs -r0 -- git rm -- &&
git commit -m 'Removed non-"A" files.' &&

git checkout -b versionB &&
find -type f -not -wholename '*.git*' -not -name '*B*' -print0 | \
	xargs -r0 -- git rm -- &&
git commit -m 'Removed non-"B" files.' &&

git checkout -b versionD master &&
find -type f -not -wholename '*.git*' -not -name '*D*' -print0 | \
	xargs -r0 -- git rm -- && git commit -m 'Removed non-"D" files.'
&&

git checkout master && git branch -v --abbrev=4 && ls -l && git checkout
versionA && ls -l && git checkout versionB && ls -l && git checkout
versionC && ls -l && git checkout versionD && ls -l

(output)
/home/bss/test
Initialized empty Git repository in /home/bss/test/.git/ Created initial
commit 8dbf3a1: All files.
 4 files changed, 4 insertions(+), 0 deletions(-)  create mode 100644
ABC.txt  create mode 100644 AC.txt  create mode 100644 BC.txt  create
mode 100644 C.txt Switched to a new branch "versionA"
rm 'BC.txt'
rm 'C.txt'
Created commit a06e10c: Removed non-"A" files.
 2 files changed, 0 insertions(+), 2 deletions(-)  delete mode 100644
BC.txt  delete mode 100644 C.txt Switched to a new branch "versionB"
rm 'AC.txt'
Created commit 2029ca2: Removed non-"B" files.
 1 files changed, 0 insertions(+), 1 deletions(-)  delete mode 100644
AC.txt Switched to a new branch "versionD"
rm 'ABC.txt'
rm 'AC.txt'
rm 'BC.txt'
rm 'C.txt'
Created commit 1793ba0: Removed non-"D" files.
 4 files changed, 0 insertions(+), 4 deletions(-)  delete mode 100644
ABC.txt  delete mode 100644 AC.txt  delete mode 100644 BC.txt  delete
mode 100644 C.txt Switched to branch "master"
* master   8dbf "C" files.
  versionA a06e Removed non-"A" files.
  versionB 2029 Removed non-"B" files.
  versionC 8dbf "C" files.
  versionD 1793 Removed non-"D" files.
total 16
-rw-r--r-- 1 bss users 4 2008-12-30 16:10 ABC.txt
-rw-r--r-- 1 bss users 3 2008-12-30 16:10 AC.txt
-rw-r--r-- 1 bss users 3 2008-12-30 16:10 BC.txt
-rw-r--r-- 1 bss users 2 2008-12-30 16:10 C.txt Switched to branch
"versionA"
total 8
-rw-r--r-- 1 bss users 4 2008-12-30 16:10 ABC.txt
-rw-r--r-- 1 bss users 3 2008-12-30 16:10 AC.txt Switched to branch
"versionB"
total 4
-rw-r--r-- 1 bss users 4 2008-12-30 16:10 ABC.txt Switched to branch
"versionC"
total 16
-rw-r--r-- 1 bss users 4 2008-12-30 16:10 ABC.txt
-rw-r--r-- 1 bss users 3 2008-12-30 16:10 AC.txt
-rw-r--r-- 1 bss users 3 2008-12-30 16:10 BC.txt
-rw-r--r-- 1 bss users 2 2008-12-30 16:10 C.txt Switched to branch
"versionD"
total 0
-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
bss@iguanasuicide.net                     ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.net/                      \_/     

^ permalink raw reply	[flat|nested] 27+ messages in thread
* RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]
@ 2008-12-30 22:36 Conor Rafferty
  2008-12-30 23:31 ` Boyd Stephen Smith Jr.
  2008-12-31  0:15 ` Daniel Barkalow
  0 siblings, 2 replies; 27+ messages in thread
From: Conor Rafferty @ 2008-12-30 22:36 UTC (permalink / raw)
  To: Boyd Stephen Smith Jr.; +Cc: git

I don't understand, sorry. I thought I'd already removed all files from
the local tree, in the $ rm *.* move just above the checkout  

-----Original Message-----
From: Boyd Stephen Smith Jr. [mailto:bss@iguanasuicide.net] 
Sent: 30 December 2008 21:49
To: Conor Rafferty
Cc: git@vger.kernel.org
Subject: Re: for newbs = little exercise / tutorial / warmup for windows
and other non-sophisticated new Git users :-) [Scanned]

On Tuesday 2008 December 30 15:27:33 you wrote:
> conorr@KINKLADZE /w/GITPLATFORM/swproj $ git status # On branch master

> nothing to commit (working directory clean)
>
> conorr@KINKLADZE /w/GITPLATFORM/swproj $ git checkout versionA .
>
> conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt  AC.txt
>
> conorr@KINKLADZE /w/GITPLATFORM/swproj $ rm *.*
>
> conorr@KINKLADZE /w/GITPLATFORM/swproj $ git checkout versionB .
>
> conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt  AC.txt  BC.txt

Not a bug.  git checkout <commit> <paths> does not delete files by
design.  
Try using "git checkout versionB" instead (no paths specified), and it
will properly remove AC.txt from your working tree as well as warning
you that "You're Doing It Wrong" (tm).
-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
bss@iguanasuicide.net                     ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.net/                      \_/     

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2008-12-31 16:34 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-31  2:27 for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned] Conor Rafferty
2008-12-31  2:35 ` Jeff Whiteside
2008-12-31  2:56 ` Boyd Stephen Smith Jr.
2008-12-31  3:10 ` Daniel Barkalow
2008-12-31  3:49   ` Daniel Barkalow
2008-12-31 12:17     ` Zorba
2008-12-31 13:48       ` Sitaram Chamarty
2008-12-31 16:24       ` Daniel Barkalow
2008-12-31 16:33         ` Sitaram Chamarty
2008-12-31 12:03   ` Zorba
2008-12-31 13:37     ` Sitaram Chamarty
  -- strict thread matches above, loose matches on Subject: below --
2008-12-31 11:10 Conor Rafferty
2008-12-31 16:00 ` Daniel Barkalow
2008-12-31 10:59 Conor Rafferty
2008-12-31  2:30 Conor Rafferty
2008-12-31  3:40 ` Boyd Stephen Smith Jr.
2008-12-31  4:48   ` Junio C Hamano
2008-12-31  5:21     ` Daniel Barkalow
2008-12-31  6:07       ` Junio C Hamano
2008-12-31 15:14     ` Boyd Stephen Smith Jr.
2008-12-30 22:55 Conor Rafferty
2008-12-31  0:12 ` Boyd Stephen Smith Jr.
2008-12-31  2:22 ` Sitaram Chamarty
2008-12-30 22:36 Conor Rafferty
2008-12-30 23:31 ` Boyd Stephen Smith Jr.
2008-12-31  0:15 ` Daniel Barkalow
2008-12-31  2:22   ` Jeff Whiteside

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).