git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: why is git destructive by default? (i suggest it not be!)
@ 2008-06-24  4:59 Teemu Likonen
       [not found] ` <e80d075a0806232201o3933d154he2b570986604c30a@mail.gmail.com>
  0 siblings, 1 reply; 64+ messages in thread
From: Teemu Likonen @ 2008-06-24  4:59 UTC (permalink / raw)
  To: David Jeske; +Cc: git

David Jeske wrote (2008-06-24 01:47 -0000):

> As a new user, I'm finding git difficult to trust, because there are
> operations which are destructive by default and capable of
> inadvertently throwing hours or days of work into the bit bucket.

I'm also quite new and I actually feel safe using git, and it's because
of reflog. No matter what I do (except manual reflog expire) I can see
where I was before with command

  git log --walk-reflogs

and get everything back. I have needed it a couple of times. So the
safety net is there, one just has to learn to trust it. :-)

Git is much safer than the standard Unix tools like rm, mv and cp.

^ permalink raw reply	[flat|nested] 64+ messages in thread
* Re: why is git destructive by default? (i suggest it not be!)
@ 2008-06-25 18:06 Dmitry Potapov
  0 siblings, 0 replies; 64+ messages in thread
From: Dmitry Potapov @ 2008-06-25 18:06 UTC (permalink / raw)
  To: David Jeske; +Cc: Brandon Casey, Jakub Narebski, Boaz Harrosh, git

On Tue, Jun 24, 2008 at 10:13:13PM -0000, David Jeske wrote:
> 
> Two things I'd like to make it easy for users to never do are:
> - delete data
> - cause refs to be dangling

Why? Let's suppose you work with CVS and you started to edit some
file and then realize than the change that you make is stupid, would
not you want just to discard these change without committing them to
CVS?

Perhaps, you are confused by thinking that git commit and cvs commit
are conceptually same commands. IMHO, far better to analogue to cvs
commit would be git push to a repository with denyNonFastForwards
policy. Git commit allows you to save your changes locally as series
of patches, but until you have not pushed them, they are not in a
permanent storage. You can change these patches, which implies that
old versions may become dangling and will be removed after reflog
expired. The idea of making of making difficult to remove some local
commits is alike the idea of an editor making difficult to remove a
line... You gain nothing from that. What editors do instead is to
provide the Undo action. Similarly, Git allows you to get back to an
old state using the reflog.

Dmitry

^ permalink raw reply	[flat|nested] 64+ messages in thread
* Re: why is git destructive by default? (i suggest it not be!)
@ 2008-06-24 12:21 Olivier Galibert
  0 siblings, 0 replies; 64+ messages in thread
From: Olivier Galibert @ 2008-06-24 12:21 UTC (permalink / raw)
  To: David Jeske; +Cc: Jakub Narebski, Avery Pennarun, Nicolas Pitre, git

On Tue, Jun 24, 2008 at 11:29:43AM -0000, David Jeske wrote:
> -- Jakub Narebski wrote:
> > If they are using '-f', i.e. force, they should know and be sure what
> > they are doing; it is not much different from 'rm -f *'.
> 
> Sure, no problem. I don't want the ability to "rm -f *". I'm raising my hand
> and saying "I don't want the power to do these things, so just turn off all the
> git commands that could be destructive and give me an alternate way to do the
> workflows I need to do". Just like a normal user on a unix machine doesn't run
> around with the power to rm -f /etc all the time, even though they may be able
> to su to root.

But you still have the power to /bin/rm -rf ~, which tends to have
worse results.  The root/user separation just tries to protect the
system's integrity from the user.  This is similar to git, whch tries
to protect the repository's integrity, which is not the same thing as
the contents.

--force exists because it is sometimes useful.  It you block it behind
some config setting, whoever is concerned will just change the config
when he needs the command and never change it back.  And windows, fsck
and other things of the kind pretty much ruined the efficiency of
confirmations before dangerous/destructive operations.  So there isn't
much left beside engaging your brain before using --force on a
command.

  OG.

^ permalink raw reply	[flat|nested] 64+ messages in thread
[parent not found: <willow-jeske-01l5oEsvFEDjCjRW>]
* Re: why is git destructive by default? (i suggest it not be!)
@ 2008-06-24  8:35 Björn Steinbrink
  0 siblings, 0 replies; 64+ messages in thread
From: Björn Steinbrink @ 2008-06-24  8:35 UTC (permalink / raw)
  To: David Jeske; +Cc: Jakub Narebski, Avery Pennarun, Nicolas Pitre, git

On 2008.06.24 08:08:13 -0000, David Jeske wrote:
> To re-ask the same question I asked in my last post, using your ascii
> pictures...
> 
> 
> Let's assume we're here..
> 
> .<---.<---.<---A<---X<---Y    <--- master
> \
> \--B<---C    <--- customer_A_branch <=== HEAD
> 
> 
> And this person and everyone else moves their head pointers back to master
> without merging:
> 
> 
> .<---.<---.<---A<---X<---Y    <--- master              <=== HEAD
> \
> \--B<---C    <--- customer_A_branch
> 
> 
> Now, five years down the road, our tree looks like:
> 
> 
> .<---A<---X<---Y<---.<--.<--.(3 years of changes)<---ZZZ<--- master  <=== HEAD
> \
> \--B<---C   <--- customer_A_branch
> 
> And someone does:
> 
> git-branch -f customer_A_branch ZZZ
> 
> To bring us to:
> 
> .<---A<---X<---Y<---.<--.(3 years of changes)<---ZZZ<--- master  <=== HEAD
> \                                           \
> \--B<---C                                   \-- customer_A_branch
> 
> 
> ..at this point, will a GC keep "B<--C", or garbage collect the commits and
> throw them away?

That would throw away the changes in _that_ repository after the reflog
entry has expired. It would not affect any other repo yet, and if that
developer tries to push that new customer_A_branch, it would be refused,
because it is not a fast-forward. And if the repo he's trying to push to
simply doesn't allow any non-fast-forward pushes, then even push -f
won't help him to destroy anything.

Björn

^ permalink raw reply	[flat|nested] 64+ messages in thread
[parent not found: <jeske@willow=01l5V7waFEDjChmh>]

end of thread, other threads:[~2008-06-26 15:17 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-24  4:59 why is git destructive by default? (i suggest it not be!) 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-25 18:06 Dmitry Potapov
2008-06-24 12:21 Olivier Galibert
     [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  8:35 Björn Steinbrink
     [not found] <jeske@willow=01l5V7waFEDjChmh>
     [not found] ` <willow-jeske-01l5PFjPFEDjCfzf-01l5V7wbFEDjCX7V>
2008-06-24  1:47   ` 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 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-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  4:40               ` David Jeske
2008-06-24  5:24                 ` Jan Krüger
     [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  8:16                           ` Jeff King
     [not found]                             ` <willow-jeske-01l5PFjPFEDjCfzf-01l5kv6TFEDjCj8S>
2008-06-24  8:30                               ` David Jeske
2008-06-24  9:39                                 ` Jakub Narebski
2008-06-24  8:30                               ` David Jeske
     [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  7:31                         ` David Jeske
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  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

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