git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* killing a branch
@ 2006-01-10 10:22 Jens Axboe
  2006-01-10 10:25 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Jens Axboe @ 2006-01-10 10:22 UTC (permalink / raw)
  To: git

Hi,

When I need to delete a branch from my git tree, I'm currently using
this (slooow) approach:

$ rm .git/refs/heads/branch-name
$ git prune

to rid myself of the branch and associated objects. Is there a faster
approach?

(please cc me, not on the list)

-- 
Jens Axboe

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

* Re: killing a branch
  2006-01-10 10:22 Jens Axboe
@ 2006-01-10 10:25 ` Junio C Hamano
  2006-01-10 10:35   ` Jens Axboe
  0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2006-01-10 10:25 UTC (permalink / raw)
  To: Jens Axboe; +Cc: git

Jens Axboe <axboe@suse.de> writes:

> $ rm .git/refs/heads/branch-name
> $ git prune
>
> to rid myself of the branch and associated objects. Is there a faster
> approach?

Perhaps the "official" way is

	$ git branch -d branch-name ;# you may need -D
        $ git prune

but that essentially is the same as what you are doing.  Note
that having dangling objects in your repository is not a crime,
and you do not have to religiously do "git prune" every time.

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

* Re: killing a branch
  2006-01-10 10:25 ` Junio C Hamano
@ 2006-01-10 10:35   ` Jens Axboe
  2006-01-10 10:52     ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Jens Axboe @ 2006-01-10 10:35 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Tue, Jan 10 2006, Junio C Hamano wrote:
> Jens Axboe <axboe@suse.de> writes:
> 
> > $ rm .git/refs/heads/branch-name
> > $ git prune
> >
> > to rid myself of the branch and associated objects. Is there a faster
> > approach?
> 
> Perhaps the "official" way is
> 
> 	$ git branch -d branch-name ;# you may need -D
>         $ git prune
> 
> but that essentially is the same as what you are doing.  Note

So no time saved there :-)

> that having dangling objects in your repository is not a crime,
> and you do not have to religiously do "git prune" every time.

I know, it just doesn't feel nice!

-- 
Jens Axboe

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

* Re: killing a branch
  2006-01-10 10:35   ` Jens Axboe
@ 2006-01-10 10:52     ` Junio C Hamano
  2006-01-10 11:26       ` Jens Axboe
  0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2006-01-10 10:52 UTC (permalink / raw)
  To: Jens Axboe; +Cc: git

Jens Axboe <axboe@suse.de> writes:

>> that having dangling objects in your repository is not a crime,
>> and you do not have to religiously do "git prune" every time.
>
> I know, it just doesn't feel nice!

Sorry, but I can think of only three reasons (and a half) why
somebody cannot live with "one git prune at the end of the day
before leaving" (or "week" for that matter) workflow:

 * the filesystem quota is too tight and you cannot afford to
   leave unused loose objects around.  May still be true on
   student accounts, perhaps, but I doubt this is much of an
   issue in the modern world anymore.

 * rsync is used to sync from a repository that dropped a branch
   just now, and you do not want to push the garbage out.  Well,
   if you are still using rsync, I'll tell about it to Linus ;-)
   Pushing via git native protocol over ssh would not send
   unreferenced objects out and will not contaminate the other
   end with the garbage.

 * you do not want to leave after starting prune before it
   finishes.  If it is your hobby to watch the paint dry, I
   cannot help you, but you could run prune under nohup (or
   always work inside "screen", which is what I do).

 + having unused things on the disk just does not _feel_ right.
   Well, maybe.  I can argue with a reason but not with a
   feeling.  On a bright side, leaving recently abandoned
   objects around for a while lets you run git-lost-found to
   recover if you accidentally deleted a still-useful branch.

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

* Re: killing a branch
  2006-01-10 10:52     ` Junio C Hamano
@ 2006-01-10 11:26       ` Jens Axboe
  2006-01-10 17:12         ` Linus Torvalds
  0 siblings, 1 reply; 8+ messages in thread
From: Jens Axboe @ 2006-01-10 11:26 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Tue, Jan 10 2006, Junio C Hamano wrote:
> Jens Axboe <axboe@suse.de> writes:
> 
> >> that having dangling objects in your repository is not a crime,
> >> and you do not have to religiously do "git prune" every time.
> >
> > I know, it just doesn't feel nice!
> 
> Sorry, but I can think of only three reasons (and a half) why
> somebody cannot live with "one git prune at the end of the day
> before leaving" (or "week" for that matter) workflow:
> 
>  * the filesystem quota is too tight and you cannot afford to
>    leave unused loose objects around.  May still be true on
>    student accounts, perhaps, but I doubt this is much of an
>    issue in the modern world anymore.

Yeah obviously not true.

>  * rsync is used to sync from a repository that dropped a branch
>    just now, and you do not want to push the garbage out.  Well,
>    if you are still using rsync, I'll tell about it to Linus ;-)
>    Pushing via git native protocol over ssh would not send
>    unreferenced objects out and will not contaminate the other
>    end with the garbage.

Haven't used rsync in a long time, I use git:// and ssh:// exclusively.

>  * you do not want to leave after starting prune before it
>    finishes.  If it is your hobby to watch the paint dry, I
>    cannot help you, but you could run prune under nohup (or
>    always work inside "screen", which is what I do).
> 
>  + having unused things on the disk just does not _feel_ right.
>    Well, maybe.  I can argue with a reason but not with a
>    feeling.  On a bright side, leaving recently abandoned
>    objects around for a while lets you run git-lost-found to
>    recover if you accidentally deleted a still-useful branch.

:-)

Alright, I'll just have to shake the habit of running git prune to rid
myself of that dirty dirty feeling.

-- 
Jens Axboe

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

* Re: killing a branch
  2006-01-10 11:26       ` Jens Axboe
@ 2006-01-10 17:12         ` Linus Torvalds
  2006-01-10 18:59           ` Jens Axboe
  0 siblings, 1 reply; 8+ messages in thread
From: Linus Torvalds @ 2006-01-10 17:12 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Junio C Hamano, git



On Tue, 10 Jan 2006, Jens Axboe wrote:
> 
> Alright, I'll just have to shake the habit of running git prune to rid
> myself of that dirty dirty feeling.

Yeah, I'm slowly shaking it off too. I used to run git-fsck-objects 
religiously just because I worried about bugs. I still do it, but 
especially with the recursive-strategy merging, I get "dangling blob" 
messages every once in a while that are _not_ due to bugs, but just due to 
the temporary merge object.

So I'm learning to ignore them, and prune the tree only occasionally, 
instead of compulsively every time.

		Linus

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

* Re: killing a branch
  2006-01-10 17:12         ` Linus Torvalds
@ 2006-01-10 18:59           ` Jens Axboe
  0 siblings, 0 replies; 8+ messages in thread
From: Jens Axboe @ 2006-01-10 18:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Junio C Hamano, git

On Tue, Jan 10 2006, Linus Torvalds wrote:
> 
> 
> On Tue, 10 Jan 2006, Jens Axboe wrote:
> > 
> > Alright, I'll just have to shake the habit of running git prune to rid
> > myself of that dirty dirty feeling.
> 
> Yeah, I'm slowly shaking it off too. I used to run git-fsck-objects 
> religiously just because I worried about bugs. I still do it, but 
> especially with the recursive-strategy merging, I get "dangling blob" 
> messages every once in a while that are _not_ due to bugs, but just due to 
> the temporary merge object.
> 
> So I'm learning to ignore them, and prune the tree only occasionally, 
> instead of compulsively every time.

Compulsive is the right word, it just itches to run the prune after
killing a branch... I'll try and learn as well.

-- 
Jens Axboe

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

* Re: killing a branch
@ 2006-01-12  9:57 linux
  0 siblings, 0 replies; 8+ messages in thread
From: linux @ 2006-01-12  9:57 UTC (permalink / raw)
  To: git

Note that "git prune" could be sped up ENORMOUSLY if git-fsck-cache
could be taught to (optionally) not open, uncompress, hash, and
verify any blob objects.  Just assume that they're okay.

I had a look at the code briefly, but it was a little bit hairier (a
more invasive change) than I felt like dealing with.

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

end of thread, other threads:[~2006-01-12  9:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-12  9:57 killing a branch linux
  -- strict thread matches above, loose matches on Subject: below --
2006-01-10 10:22 Jens Axboe
2006-01-10 10:25 ` Junio C Hamano
2006-01-10 10:35   ` Jens Axboe
2006-01-10 10:52     ` Junio C Hamano
2006-01-10 11:26       ` Jens Axboe
2006-01-10 17:12         ` Linus Torvalds
2006-01-10 18:59           ` Jens Axboe

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).