POV-Ray : Newsgroups : povray.off-topic : Git Server Time
29 Jul 2024 10:31:27 EDT (-0400)
  Git (Message 21 to 30 of 51)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Invisible
Subject: Re: Git
Date: 11 Apr 2012 09:19:00
Message: <4f8584c4$1@news.povray.org>
On 10/04/2012 01:55 PM, Invisible wrote:

> So far, that understanding hasn't caused me too many problems. And I
> quite like the way that a single repository holds multiple branches.
> Darcs follows an "every repository /is/ a branch" mentality. Which
> works, but makes it kinda long-winded to change branches. In NetBeans, I
> can click "switch branch" and all my code suddenly changes.

It also means that you can fairly easily copy a file from one branch to 
another, as I just discovered...


Post a reply to this message

From: Invisible
Subject: Re: Git
Date: 11 Apr 2012 09:37:05
Message: <4f858901$1@news.povray.org>
On 11/04/2012 02:19 PM, Invisible wrote:
> On 10/04/2012 01:55 PM, Invisible wrote:
>
>> So far, that understanding hasn't caused me too many problems. And I
>> quite like the way that a single repository holds multiple branches.
>> Darcs follows an "every repository /is/ a branch" mentality. Which
>> works, but makes it kinda long-winded to change branches. In NetBeans, I
>> can click "switch branch" and all my code suddenly changes.
>
> It also means that you can fairly easily copy a file from one branch to
> another, as I just discovered...

OTOH, if you do this with Darcs, you keep the file history, since Darcs 
tracks individual files, not entire repositories. But on the first hand 
again, you can't copy a history if it involves files you don't want to 
copy...


Post a reply to this message

From: Darren New
Subject: Re: Git
Date: 12 Apr 2012 12:16:41
Message: <4f86ffe9$1@news.povray.org>
On 4/11/2012 2:23, Invisible wrote:
> 1. Delete the last commit /and the changes it contained/. (Why would you
> ever want to do this?)

Changes aren't stored in git, so naturally deleting a commit deletes the 
changes. Delete the commit without deleting the changes in your working 
copy, and then create a new commit based on those changes.

> 2. Move the head back one commit, but not actually delete the commit.

If nothing points to the commit, it's effectively deleted.

> 3. Move the head back one commit, but not actually delete the commit, and
> leave the changes in the staging area.

There you go.

> Nowhere is there an option that says "perform the exact inverse of what I
> just told you to do".

I'm not sure what you're trying to say. #3 does what you want, if you follow 
it up with "delete commits that no heads or other commits point to."

It's like you're complaining "there's no one option that both deletes the 
directory element *and* removes the file's data."

>> "git gc" with the appropriate options to prune.
>
> That at least might work. (Somebody somewhere says prune only removes
> dangling branches older than 2 weeks.)

That would be the "appropriate options" to modify. Tell it to use zero days.

Why are you hell-bent on getting rid of that commit? Do you zero out all the 
sectors of your hard drive every time you delete a file?

> It's really quite frustrating how all
> this documentation seems to be tutorials, blog posts and SO questions. Isn't
> there a /reference manual/ somewhere??

I pointed you to it. Plus, there's the man pages, which you often complain 
you don't like because it's not tutorial enough. :-)

> If your commit is wrong, you don't /want/ to keep it. :-P

And in git, you don't. You just have the option of undeleting it for a week 
or two.

> But seriously, if
> I want to change something, why shouldn't I be able to change it? Git has an
> "amend" command, it's just that it doesn't /amend/ the commit - it creates a
> new one, but leaves the old one in place.

Files are named after their contents. If you want to make a change, by 
definition, you have to give it a new name.

 > The Darcs "amend" command actually
> deletes the amended commit - you know, like what you'd expect an amendment
> to consist of. :-P

So your concern is that there's a commit out in the git data store that 
nothing points to, that will get gc'ed in a couple of weeks, and which you 
don't want to manually have to run an extra step to get rid of it before then?

> I agree it's not a good idea to go back and start changing history from 2
> years ago. But I don't see why you can't edit the last committed change.
> That just seems like a silly limitation.

You can. That's exactly what the -amend option does. It creates a new commit 
because you changed the content and it has to be given a new name.

> In a sense, Darcs /isn't/ that worried about losing commits. In Darcs, a
> branch is a repository, and so to remove changes from a branch, you have to
> delete commits. That's just how it works.

Right. And you can remove commits from git by deleting them. You're just 
unhappy that git asks you to take two steps (or wait a while) to remove a 
commit irrevocably.

>>> Then again, shouldn't you be recording those
>>> two changes in the same commit?
>>
>> Heavens no!
>
> You shouldn't group related changes together, no?

No. You should group the minimum number of changes that gives you a 
consistent state.  What if you find the implementation of the routine is 
right, but the code calling it is all screwed up?

> That's the other thing. With Darcs, I edit some files for a while, and then
> say "commit this". It shows me each and every change, and asks if I want to
> include that. And even though I've only got one set of changed files, I can
> syphon off the changes and ground them into several logically separate
> commits. Git can't seem to do that.

Sure it can. That's the coolest thing about git. Indeed, that's exactly the 
point of the staging area being different from the working directory. You 
copy the changes you want to commit into the staging area, then commit it.

What you mean is "netbeans interface to git doesn't do that."

> What I end up doing is just committing /everything/, because it's less
> hassle. But then if I ever need to go back, I'd have to go in big giant
> steps rather than small logical increments.

You're doing it wrong. Don't blame git for netbeans not being git.

> How about /not/ having to make a commit that records changes that I've
> already committed? :-P

You never made the change before where both pieces of code are in the same file.

> Actually, it would probably be easier if NetBeans would actually show me,
> you know, /a history/, so I can see what's actually /happening/, rather than
> just having to try to guess from the hashes which branches contain what...

Again, you're looking at a bad interface to git, and then complaining git 
doesn't work. It's like looking at command.com and complaining "there's no 
way to automate access to excel spreadsheets!"  Nothing you're complaining 
about is true of the git tools, only netbeans.

-- 
Darren New, San Diego CA, USA (PST)
   "Oh no! We're out of code juice!"
   "Don't panic. There's beans and filters
    in the cabinet."


Post a reply to this message

From: Darren New
Subject: Re: Git
Date: 12 Apr 2012 12:19:40
Message: <4f87009c$1@news.povray.org>
On 4/11/2012 2:57, Warp wrote:
>    Who thought this would be a good idea?

On the other hand, it prevents you from having to check out the entire 
repository just to get one project.

-- 
Darren New, San Diego CA, USA (PST)
   "Oh no! We're out of code juice!"
   "Don't panic. There's beans and filters
    in the cabinet."


Post a reply to this message

From: Darren New
Subject: Re: Git
Date: 12 Apr 2012 12:20:36
Message: <4f8700d4$1@news.povray.org>
On 4/11/2012 3:33, Le_Forgeron wrote:
> (ok, give me a usage of a hammer for a gardener ?)

Snails.  Wheeee!

-- 
Darren New, San Diego CA, USA (PST)
   "Oh no! We're out of code juice!"
   "Don't panic. There's beans and filters
    in the cabinet."


Post a reply to this message

From: Darren New
Subject: Re: Git
Date: 12 Apr 2012 12:21:38
Message: <4f870112$1@news.povray.org>
On 4/11/2012 3:27, Invisible wrote:
> Question: Who designed gitk to default to using black text on a navy blue
> background? That's frigging *absurd*! Fortunately, you can change it -
> because it's utterly illegible!

Had the same problem with Eclipse. Turns out that it's picking up half the 
configuration from its own files, the other half from the "system colors", 
and assuming the system colors are (for example) that windows of certain 
types are light colored instead of dark colored.

-- 
Darren New, San Diego CA, USA (PST)
   "Oh no! We're out of code juice!"
   "Don't panic. There's beans and filters
    in the cabinet."


Post a reply to this message

From: Darren New
Subject: Re: Git
Date: 12 Apr 2012 12:22:53
Message: <4f87015d$1@news.povray.org>
On 4/11/2012 6:37, Invisible wrote:
> OTOH, if you do this with Darcs, you keep the file history, since Darcs
> tracks individual files, not entire repositories.

Git deduces this, which is the right way to do it, methinks. Darcs can't 
*really* tell if this file came from that file. It can only record what you 
told it.

-- 
Darren New, San Diego CA, USA (PST)
   "Oh no! We're out of code juice!"
   "Don't panic. There's beans and filters
    in the cabinet."


Post a reply to this message

From: Invisible
Subject: Re: Git
Date: 13 Apr 2012 04:04:19
Message: <4f87de03$1@news.povray.org>
On 12/04/2012 05:20 PM, Darren New wrote:
> On 4/11/2012 3:33, Le_Forgeron wrote:
>> (ok, give me a usage of a hammer for a gardener ?)
>
> Snails. Wheeee!

CANNOT UNSEE. >_<


Post a reply to this message

From: Invisible
Subject: Re: Git
Date: 13 Apr 2012 04:05:29
Message: <4f87de49$1@news.povray.org>
On 12/04/2012 05:21 PM, Darren New wrote:
> On 4/11/2012 3:27, Invisible wrote:
>> Question: Who designed gitk to default to using black text on a navy blue
>> background? That's frigging *absurd*! Fortunately, you can change it -
>> because it's utterly illegible!
>
> Had the same problem with Eclipse. Turns out that it's picking up half
> the configuration from its own files, the other half from the "system
> colors", and assuming the system colors are (for example) that windows
> of certain types are light colored instead of dark colored.

Hmm. Well, under Windows XP, the window title colour /is/ navy blue... I 
notice that when I ran it under GNOME, it looked fine. So yeah, maybe 
that's it.


Post a reply to this message

From: Invisible
Subject: Re: Git
Date: 13 Apr 2012 04:07:31
Message: <4f87dec3$1@news.povray.org>
On 12/04/2012 05:22 PM, Darren New wrote:
> On 4/11/2012 6:37, Invisible wrote:
>> OTOH, if you do this with Darcs, you keep the file history, since Darcs
>> tracks individual files, not entire repositories.
>
> Git deduces this, which is the right way to do it, methinks. Darcs can't
> *really* tell if this file came from that file. It can only record what
> you told it.

I have repository A, which contains file X. I have repository B, which 
does not contain file X. I pull all the changes relating to file X from 
repository A into repository B. Now B contains X, and all its history.

If I do this with Git branches, then on branch B, a file named X 
suddenly shows up, but there's no record that it was actually copied 
from branch A. It just records what's /in/ the file.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.