git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: "David Jeske" <jeske@google.com>
Cc: Jeff King <peff@peff.net>, "Avery Pennarun" <apenwarr@gmail.com>,
	"Nicolas Pitre" <nico@cam.org>,
	git@vger.kernel.org
Subject: Re: why is git destructive by default? (i suggest it not be!)
Date: Tue, 24 Jun 2008 02:39:20 -0700 (PDT)	[thread overview]
Message-ID: <m3ej6nkw2u.fsf@localhost.localdomain> (raw)
In-Reply-To: <15381.9593288519$1214297235@news.gmane.org>

"David Jeske" <jeske@google.com> writes:

> This is mostly moot since I've understood that it's easy to set git
> to never GC. I guess I'm curious about why those GC fields would
> ever be set to anything other than never?

Because not everybody has unlimited quota / unlimited disk space?
Besides growing repository, reflogs also grow even if you shitch
between some limited set of commits.

Note however that IIRC reflogs are not enabled by default for bare
repositories, and public repositories should be bare (without working
directory).  But see receive.denyNonFastForwards below.

> -- Jeff King wrote:
> >
> > No. Git keeps the reachable DAG. So if the DAG is part of development
> > that is merged into one of your long running branches, or if you keep
> > around the branch that points to it, it will never go away.
> 
> Right, that's what I thought.
> 
> I'm not primarily concerned with what developers can do to their
> local git repositories. I'm concerned with what the default sync
> operations can let them do to the crown-jewels in the 'central
> organization repositories' which everyone is periodically pushing
> to.
> 
> I like that deleting a branch in your repo does not cause it to be
> deleted in other repos. Presumably in an organization we could
> prevent the central repo from ever accepting branch deletes from
> developers. (without some kind of authorization)
> 
> Does it have the same protection for all operations that can cause
> DAGs to be dangling? For example, if they branch -f" and push the
> branch?

git-config(1)

  receive.denyNonFastForwards::
        If set to true, git-receive-pack will deny a ref update which is
        not a fast forward. Use this to prevent such an update via a push,
        even if that push is forced. This configuration variable is
        set when initializing a shared repository.

That is even more than protection against leaving some commits
dangling.  This makes working on top of published branches safe.

If such all-or-nothing policy is not for you, you can always set-up
hooks, like shown for example in contrib/hooks/update-paranoid

Or you can use different workflow, where maintainer _pulls_ from other
developers or groups of developers, or apply (git-am) patches from
email.  This way if you screw up, it would be your fault for not
having backups ;-)

[...]
> Quite a bit of my fear of losing data came from some issues in the
> git-gui. I'm trying out git on a windows project, and windows-shells
> just don't work right, so I'm using the "Git Gui". It turns out
> right-clicking on a history entry in the gui has no checkout option,

This might be result of the fact that in older versions of git you
could not checkout arbitrary commit.  You now can use so called
"detached HEAD" (when current branch pointer points directly to the
commit, instead of pointing to current branch [name]); note however
that comitting on top of detached HEAD is discouraged.

> and the only option it does have which will let you move the tree to
> that place is "reset --hard".. since this was the easiest thing to
> find in the GUI, I assumed it was the right way to do it, and then
> all my more recent changes disappeared. It doesn't seem to have
> reflog functionality, so I couldn't find any way to get back all my
> changes.

There is always ORIG_HEAD, which predates reflog introduction, and
contains only old "version", as in

  $ git reset --hard ORIG_HEAD


That said, it would be nice if git-gui had some reflog interface.

> [...] The docs clearly explained that it
> will garbage collect dangling refs, and frankly the information
> about how often this happens is buried so deep I had no idea what
> the frequency was.

git-gc(1), section called (suprise, suprise) "Configuration".

-- 
Jakub Narebski
Poland
ShadeHawk on #git

  reply	other threads:[~2008-06-24  9:40 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jeske@willow=01l5V7waFEDjChmh>
     [not found] ` <willow-jeske-01l5PFjPFEDjCfzf-01l5V7wbFEDjCX7V>
2008-06-24  1:47   ` why is git destructive by default? (i suggest it not be!) David Jeske
2008-06-24 17:11     ` Boaz Harrosh
2008-06-24 17:19       ` Boaz Harrosh
2008-06-24 19:08         ` Jakub Narebski
     [not found]           ` <willow-jeske-01l5PFjPFEDjCfzf-01l5zrLdFEDjCV3U>
2008-06-24 20:04             ` David Jeske
2008-06-24 21:42               ` Brandon Casey
     [not found]                 ` <willow-jeske-01l5PFjPFEDjCfzf-01l63P33FEDjCVQ0>
2008-06-24 22:13                   ` David Jeske
2008-06-24 22:13                   ` David Jeske
2008-06-24 22:54                 ` Theodore Tso
2008-06-24 23:07                   ` Junio C Hamano
2008-06-25  2:26                     ` Theodore Tso
2008-06-25  8:58                       ` Jakub Narebski
2008-06-25  9:14                         ` Junio C Hamano
2008-06-26 15:13                       ` Brandon Casey
2008-06-24 22:21               ` Steven Walter
2008-06-24 22:21                 ` [PATCH] cmd_reset: don't trash uncommitted changes unless told to Steven Walter
2008-06-24 22:31                   ` Junio C Hamano
2008-06-25  9:12                     ` Boaz Harrosh
2008-06-25  9:23                       ` Junio C Hamano
2008-06-25  9:59                         ` Boaz Harrosh
2008-06-25 10:16                       ` Johannes Schindelin
2008-06-25 10:24                         ` Matthias Kestenholz
2008-06-25 10:46                           ` Anton Gladkov
2008-06-25 12:33                             ` Johannes Schindelin
2008-06-25 14:49                             ` [PATCH] cmd_reset: don't trash uncommitted changes unless toldto Craig L. Ching
2008-06-25 15:18                               ` Anton Gladkov
2008-06-25 10:41                         ` [PATCH] cmd_reset: don't trash uncommitted changes unless told to Johannes Sixt
2008-06-25 12:38                           ` Johannes Schindelin
2008-06-25 13:51                             ` Theodore Tso
2008-06-25 17:22                               ` Junio C Hamano
2008-06-25 19:50                                 ` Theodore Tso
2008-06-25 20:04                                   ` Avery Pennarun
2008-06-25 20:11                                     ` Junio C Hamano
2008-06-25 20:22                                       ` Avery Pennarun
2008-06-25 20:48                                         ` Junio C Hamano
2008-06-25 20:58                                           ` Avery Pennarun
2008-06-25 21:24                                             ` Re* " Junio C Hamano
2008-06-25 21:34                                               ` Junio C Hamano
2008-06-26  1:26                                               ` Junio C Hamano
2008-06-25 20:37                                       ` Steven Walter
2008-06-25 20:38                                     ` Theodore Tso
2008-06-25 20:50                                       ` Junio C Hamano
2008-06-25 21:05                                         ` Theodore Tso
2008-06-25 21:35                                           ` Junio C Hamano
2008-06-26  5:16                                             ` Junio C Hamano
     [not found]                                             ` <20080627193325.6117@nanako3.lavabit.com>
2008-06-27 22:11                                               ` Junio C Hamano
2008-06-28  0:06                                                 ` しらいしななこ
2008-06-28 22:32                                                   ` しらいしななこ
2008-06-29  8:56                                                     ` Junio C Hamano
2008-06-25 22:44                                       ` Petr Baudis
2008-06-26  1:59                                         ` Johannes Schindelin
2008-06-25 20:09                                   ` Junio C Hamano
2008-06-26 11:55                                 ` Björn Steinbrink
2008-06-26 12:07                                   ` Johannes Schindelin
2008-06-26 12:35                                     ` Björn Steinbrink
2008-06-26 15:55                                     ` Avery Pennarun
2008-06-26 17:49                                       ` Johannes Schindelin
2008-06-26 12:01                               ` Matthieu Moy
2008-06-26 12:09                                 ` Johannes Schindelin
2008-06-26 12:23                                   ` David Kastrup
2008-06-25 13:19                       ` Ian Hilt
2008-06-26  5:31                       ` Andreas Ericsson
2008-06-26 16:15                         ` Jon Loeliger
2008-06-25  5:29                   ` Johannes Gilger
2008-06-24 20:04             ` why is git destructive by default? (i suggest it not be!) David Jeske
2008-06-25  8:57           ` Boaz Harrosh
2008-06-24 18:18       ` Brandon Casey
2008-06-24  1:47   ` David Jeske
     [not found] ` <willow-jeske-01l5PFjPFEDjCfzf-01l5V7wbFEDjCX7V@videotron.ca>
     [not found]   ` <willow-jeske-01l5cKsCFEDjC=91MX@videotron.ca>
2008-06-24  2:17     ` Nicolas Pitre
     [not found]       ` <willow-jeske-01l5PFjPFEDjCfzf-01l5ciVtFEDjCaD9>
2008-06-24  3:18         ` David Jeske
2008-06-24  8:14           ` Lea Wiemann
2008-06-24  3:18         ` David Jeske
     [not found]       ` <willow-jeske-01l5PFjPFEDjCfzf-01l5ciVtFEDjCaD9@videotron.ca>
     [not found]         ` <willow-jeske-01l5e9cgFEDjCh3F@videotron.ca>
2008-06-24  4:03           ` Nicolas Pitre
     [not found]             ` <willow-jeske-01l5PFjPFEDjCfzf-01l5fAcTFEDjCWA4>
2008-06-24  4:40               ` David Jeske
2008-06-24  5:24                 ` Jan Krüger
2008-06-24  4:40               ` David Jeske
     [not found]             ` <1978205964779154253@unknownmsgid>
2008-06-24  5:20               ` Avery Pennarun
     [not found]                 ` <willow-jeske-01l5PFjPFEDjCfzf-01l5gtQ7FEDjCWCC>
2008-06-24  6:35                   ` David Jeske
2008-06-24  7:24                     ` Jeff King
     [not found]                       ` <willow-jeske-01l5PFjPFEDjCfzf-01l5jmMuFEDjChvB>
2008-06-24  7:31                         ` David Jeske
2008-06-24  7:31                         ` David Jeske
2008-06-24  8:16                           ` Jeff King
     [not found]                             ` <willow-jeske-01l5PFjPFEDjCfzf-01l5kv6TFEDjCj8S>
2008-06-24  8:30                               ` David Jeske
2008-06-24  8:30                               ` David Jeske
2008-06-24  9:39                                 ` Jakub Narebski [this message]
     [not found]                             ` <willow-jeske-01l5PFjPFEDjCfzf-01l5kv6TFEDjCj8S@brm-avmta-1.central.sun.com>
     [not found]                               ` <willow-jeske-01l5lTEoFEDjCVta@brm-avmta-1.central.sun.com>
2008-06-24 10:01                                 ` Fedor Sergeev
2008-06-24 10:24                                   ` David Jeske
2008-06-24 13:13                                     ` Theodore Tso
2008-06-24  6:35                   ` David Jeske
2008-06-24  7:54                 ` Jakub Narebski
     [not found]                   ` <willow-jeske-01l5PFjPFEDjCfzf-01l5kQf4FEDjCXUa>
2008-06-24  8:08                     ` David Jeske
2008-06-24 11:22                       ` Jakub Narebski
     [not found]                         ` <willow-jeske-01l5PFjPFEDjCfzf-01l5p7eVFEDjCZRD>
2008-06-24 11:29                           ` David Jeske
2008-06-24 12:21                             ` Jakub Narebski
2008-06-24 11:29                           ` David Jeske
2008-06-24 12:19                             ` Rogan Dawes
2008-06-24 12:35                               ` Johannes Gilger
2008-06-24 12:46                                 ` Rogan Dawes
2008-06-24 12:13                         ` Jakub Narebski
2008-06-24  8:08                     ` David Jeske
2008-06-24  4:59 Teemu Likonen
     [not found] ` <e80d075a0806232201o3933d154he2b570986604c30a@mail.gmail.com>
2008-06-24  5:43   ` Teemu Likonen
  -- strict thread matches above, loose matches on Subject: below --
2008-06-24  8:35 Björn Steinbrink
     [not found] <willow-jeske-01l5oEsvFEDjCjRW>
     [not found] ` <willow-jeske-01l5PFjPFEDjCfzf-01l5oEswFEDjCZBN>
2008-06-24 10:42   ` David Jeske
2008-06-24 15:29     ` Brandon Casey
     [not found]       ` <willow-jeske-01l5PFjPFEDjCfzf-01l5uqS9FEDjCcuF>
2008-06-24 16:41         ` David Jeske
2008-06-24 18:55           ` Brandon Casey
2008-06-25 12:20           ` Matthieu Moy
2008-06-25 17:56           ` Jing Xue
2008-06-24 16:41         ` David Jeske
2008-06-24 10:42   ` David Jeske
2008-06-24 12:21 Olivier Galibert
2008-06-25 18:06 Dmitry Potapov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ej6nkw2u.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jeske@google.com \
    --cc=nico@cam.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).