* 'typechange' in the git-status output
@ 2011-03-14 18:29 Alexei Sholik
2011-03-14 18:39 ` Jeff King
2011-03-14 18:39 ` Alexei Sholik
0 siblings, 2 replies; 7+ messages in thread
From: Alexei Sholik @ 2011-03-14 18:29 UTC (permalink / raw)
To: git
Hi git,
I cloned git mirror from github[1]. When I run git-status in it's
working directory, I see no output.
But then, after copying the whole directory with 'cp -r' and running
git-status in the newly created directory, I get the following:
> # On branch master
> # Changed but not updated:
> # (use "git add <file>..." to update what will be committed)
> # (use "git checkout -- <file>..." to discard changes in working directory)
> #
> # typechange: RelNotes
git-diff shows
> diff --git a/RelNotes b/RelNotes
> new file mode 100644
> index 0000000..56c3863
> --- /dev/null
> +++ b/RelNotes
> ... // the whole contents of the file
Both copies of the repository are on the branch master with the latest
commit 07873dc. Simply diffing copies of the RelNotes file gives no
output.
What happened with the copied repository? I've found a couple of
instances of the word 'typechange' in the source, but no mention in
the docs. What does it mean and what could be the cause of this
change?
[1]: git://github.com/git/git.git
--
Best regards,
Alexei Sholik
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 'typechange' in the git-status output
2011-03-14 18:29 'typechange' in the git-status output Alexei Sholik
@ 2011-03-14 18:39 ` Jeff King
2011-03-14 18:39 ` Alexei Sholik
1 sibling, 0 replies; 7+ messages in thread
From: Jeff King @ 2011-03-14 18:39 UTC (permalink / raw)
To: Alexei Sholik; +Cc: git
On Mon, Mar 14, 2011 at 08:29:57PM +0200, Alexei Sholik wrote:
> But then, after copying the whole directory with 'cp -r' and running
> git-status in the newly created directory, I get the following:
"cp -r" isn't an exact copy. You probably want "cp -a" or at least "cp
-rs".
> > # On branch master
> > # Changed but not updated:
> > # (use "git add <file>..." to update what will be committed)
> > # (use "git checkout -- <file>..." to discard changes in working directory)
> > #
> > # typechange: RelNotes
Right. RelNotes is a symlink. But "cp -r" dereferences the symlink and
copies the file contents themselves.
> What happened with the copied repository? I've found a couple of
> instances of the word 'typechange' in the source, but no mention in
> the docs. What does it mean and what could be the cause of this
> change?
It's the same as the "T" flag in "git diff --name-status". Namely, the
type of the file changed (between a symlink and a regular file).
-Peff
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 'typechange' in the git-status output
2011-03-14 18:29 'typechange' in the git-status output Alexei Sholik
2011-03-14 18:39 ` Jeff King
@ 2011-03-14 18:39 ` Alexei Sholik
2011-03-14 18:59 ` Drew Northup
1 sibling, 1 reply; 7+ messages in thread
From: Alexei Sholik @ 2011-03-14 18:39 UTC (permalink / raw)
To: git
On 14 March 2011 20:29, Alexei Sholik <alcosholik@gmail.com> wrote:
> Hi git,
>
> I cloned git mirror from github[1]. When I run git-status in it's
> working directory, I see no output.
>
> But then, after copying the whole directory with 'cp -r' and running
> git-status in the newly created directory, I get the following:
>
>> # On branch master
>> # Changed but not updated:
>> # (use "git add <file>..." to update what will be committed)
>> # (use "git checkout -- <file>..." to discard changes in working directory)
>> #
>> # typechange: RelNotes
>
> git-diff shows
>
>> diff --git a/RelNotes b/RelNotes
>> new file mode 100644
>> index 0000000..56c3863
>> --- /dev/null
>> +++ b/RelNotes
>> ... // the whole contents of the file
>
> Both copies of the repository are on the branch master with the latest
> commit 07873dc. Simply diffing copies of the RelNotes file gives no
> output.
>
> What happened with the copied repository? I've found a couple of
> instances of the word 'typechange' in the source, but no mention in
> the docs. What does it mean and what could be the cause of this
> change?
>
>
> [1]: git://github.com/git/git.git
>
> --
> Best regards,
> Alexei Sholik
>
Right, I've figured out the root of the change.
'ls -l' on the original RelNotes outputs:
lrwxr-xr-x 1 alco staff 32 Mar 14 20:35 RelNotes ->
Documentation/RelNotes/1.7.5.txt
'ls -l' on the copied RelNotes outputs:
-rw-r--r-- 1 alco staff 1810 Mar 14 20:10 RelNotes
So the problem is with the cp, not git. But I wonder if it is
mentioned anywhere in the docs? Probably, git-clone's or git-status'
manpage would be a proper place?
--
Best regards,
Alexei Sholik
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 'typechange' in the git-status output
2011-03-14 18:39 ` Alexei Sholik
@ 2011-03-14 18:59 ` Drew Northup
2011-03-14 19:22 ` Jonathan Nieder
0 siblings, 1 reply; 7+ messages in thread
From: Drew Northup @ 2011-03-14 18:59 UTC (permalink / raw)
To: Alexei Sholik; +Cc: git, Jeff King
On Mon, 2011-03-14 at 20:39 +0200, Alexei Sholik wrote:
> On 14 March 2011 20:29, Alexei Sholik <alcosholik@gmail.com> wrote:
> > Hi git,
> >
> > I cloned git mirror from github[1]. When I run git-status in it's
> > working directory, I see no output.
> >
> > But then, after copying the whole directory with 'cp -r' and running
> > git-status in the newly created directory, I get the following:
> Right, I've figured out the root of the change.
>
> 'ls -l' on the original RelNotes outputs:
> lrwxr-xr-x 1 alco staff 32 Mar 14 20:35 RelNotes ->
> Documentation/RelNotes/1.7.5.txt
>
> 'ls -l' on the copied RelNotes outputs:
> -rw-r--r-- 1 alco staff 1810 Mar 14 20:10 RelNotes
>
> So the problem is with the cp, not git. But I wonder if it is
> mentioned anywhere in the docs? Probably, git-clone's or git-status'
> manpage would be a proper place?
Quoting Jeff King <peff@peff.net>:
> "cp -r" isn't an exact copy. You probably want "cp -a" or at least "cp
> -rs".
.....
> Right. RelNotes is a symlink. But "cp -r" dereferences the symlink and
> copies the file contents themselves.
As has been said more than a few times (and is probably somewhere in the
docs), if you really want to duplicate a git repo you should probably be
using git to do it. No change to the manpages is required here.
--
-Drew Northup
________________________________________________
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 'typechange' in the git-status output
2011-03-14 18:59 ` Drew Northup
@ 2011-03-14 19:22 ` Jonathan Nieder
2011-03-14 19:27 ` Jeff King
2011-03-14 19:44 ` Junio C Hamano
0 siblings, 2 replies; 7+ messages in thread
From: Jonathan Nieder @ 2011-03-14 19:22 UTC (permalink / raw)
To: Drew Northup; +Cc: Alexei Sholik, git, Jeff King
Hi,
Drew Northup wrote:
> As has been said more than a few times (and is probably somewhere in the
> docs), if you really want to duplicate a git repo you should probably be
> using git to do it.
FWIW I don't agree with this advice. "cp -a" works perfectly well and
I think that's a valuable thing.
On the other hand, if you want to _back up_ or sneakernet a git repo,
I agree that "git bundle create /path/to/backup.bundle --all" is
better.
Perhaps the user manual could explain this somewhere.
Hope that helps,
Jonathan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 'typechange' in the git-status output
2011-03-14 19:22 ` Jonathan Nieder
@ 2011-03-14 19:27 ` Jeff King
2011-03-14 19:44 ` Junio C Hamano
1 sibling, 0 replies; 7+ messages in thread
From: Jeff King @ 2011-03-14 19:27 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Drew Northup, Alexei Sholik, git
On Mon, Mar 14, 2011 at 02:22:38PM -0500, Jonathan Nieder wrote:
> Hi,
>
> Drew Northup wrote:
>
> > As has been said more than a few times (and is probably somewhere in the
> > docs), if you really want to duplicate a git repo you should probably be
> > using git to do it.
>
> FWIW I don't agree with this advice. "cp -a" works perfectly well and
> I think that's a valuable thing.
Agreed. Note that "cp -a" really _duplicates_ a repo: refs, config,
unreferenced objects, current packed state, etc. Using git to copy makes
a clone, which is subtly different. So I don't think there is any reason
to dissuade people from "cp -a" (cp without "-a", on the other hand, can
be problematic as shown here).
-Peff
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 'typechange' in the git-status output
2011-03-14 19:22 ` Jonathan Nieder
2011-03-14 19:27 ` Jeff King
@ 2011-03-14 19:44 ` Junio C Hamano
1 sibling, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2011-03-14 19:44 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Drew Northup, Alexei Sholik, git, Jeff King
Jonathan Nieder <jrnieder@gmail.com> writes:
> On the other hand, if you want to _back up_ or sneakernet a git repo,
> I agree that "git bundle create /path/to/backup.bundle --all" is
> better.
>
> Perhaps the user manual could explain this somewhere.
I agree "bundle" documentation would be a good place to show that "better"
way.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-03-14 19:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-14 18:29 'typechange' in the git-status output Alexei Sholik
2011-03-14 18:39 ` Jeff King
2011-03-14 18:39 ` Alexei Sholik
2011-03-14 18:59 ` Drew Northup
2011-03-14 19:22 ` Jonathan Nieder
2011-03-14 19:27 ` Jeff King
2011-03-14 19:44 ` Junio C Hamano
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).