git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Josef 'Jeff' Sipek <jeffpc@josefsipek.net>,
	Per Cederqvist <ceder@lysator.liu.se>,
	git@vger.kernel.org
Subject: Re: [PATCH] Added guilt.reusebranch configuration option.
Date: Thu, 23 May 2013 14:37:59 -0400	[thread overview]
Message-ID: <20130523183759.GB1275@thunk.org> (raw)
In-Reply-To: <CALkWK0kyRno4eMYHXC3RkJFCVZ6DJWgFX=pR+WCu8=Gaf9q=Mw@mail.gmail.com>

On Thu, May 23, 2013 at 03:22:50PM +0530, Ramkumar Ramachandra wrote:
> Theodore Ts'o wrote:
> > Right now I do this just by being careful, but if there was an
> > automatic safety mechanism, it would save me a bit of work, since
> > otherwise I might not catch my mistake until I do the "git push
> > publish", at which point I curse and then start consulting the reflog
> > to back the state of my tree out, and then reapplying the work I had
> > to the right tree.
> 
> My scenario is a bit different, and I think this safety feature is
> highly overrated.  It's not that "I'll never rewind some branches, but
> rewind other branches", but rather "I might rewind anything at any
> time, but I want immediate information so I can quickly inspect @{1}
> to see if that was undesirable".

Spekaing of which, what I'd really appreciate is timestamps associated
with the reflog.  That's because the most common time when I've
screwed something up is after doing a "git rebase -i" and so the
reflog has a *huge* number of entries on it, and figuring out which
entry in the reflog is the right one is painful.  If could tell at a
glance when each entry of the reflog was created, it would make it a
lot easier to untangle a tree mangled by git rebase -i.

In practice, it means I waste five minutes carefully inspecting a few
dozen entries on the reflog, so it's not a disaster, although I'm
generally cursing the whole time while I'm trying to untangle the
whole mess.

This issue with reflogs not having timestamps isn't primarily about
rewind safety, BTW; it's just one of the things which make consulting
the reflog painful --- and it's much more likely happens after I screw
up a git rebase -i, generally because of what happens when there's a
merge conflict and then I accidentally fold two commits together
unintentionally.  The times when I've screwed up a non-rewinding
branch and then needed to recover after discovering the problem when I
try to publish said branch are admittedly rare; maybe once or twice
times in the past twelve months.

> So, do you still need this rewinding safety thing?

Meh; I don't *need* it.  But then again, I'm an fairly experienced git
user.  The fact that I use guilt without the "guilt/master" safety
feature and have never gotten bitten by it --- in fact I deliberately
publish rewindable branches with a guilt patch series applies speaks
to the fact that I'm pretty experienced at rewindable heads.

The only reason why I suggested it is because I believe it would be
useful for people with less experience, and perhaps it would help make
rewindable branches less scary, and less subject to a lot of the
fearmongering that you see on the blogosphere.

> 
> > So what I do is something like this:
> >
> > git push publish ; git push repo ; git push code
> 
> While we can definitely make the UI better for this (maybe push
> --multiple?), there is no fundamental change: we have to re-initialize
> all the refspecs, connect to the remote via the transport layer and
> prepare a packfile to send.  In other words, it's impossible to make
> it any faster than what you get with the above.

Sure, and if I cared I'd make a git alias to automate this, instead of
depending on finger macros.

> So you're a batched-push person.  And the above makes it clear that
> you don't want to explicitly differentiate between a push and push -f
> (the +pu thing).  And this assumes that you never create any new
> branches (I branch out all the time), otherwise you'd have rules for
> refs/heads/*.

I create new branches all the time.  But they are for my own personal
testing purposes.  So it's fairer to say that I rarely *publish* new
branches; I generally stick to the standard set of next, master,
maint, and pu.  And part of that is that even publishing this number
of branches is enough to sometimes confuse the e2fsprogs developers
who are pulling from my tree.

So what I've done in the past is to create a whole bunch of feature
branches, and then merge them into the pu branch, and then only
publish the pu branch.  And I try to get the feature branches cleaned
up as quickly as I have time, so they can appear on the maint or
master/next branches sooner rather than later.

> Just out of curiosity, do you ever have ref-renaming
> requirements (like push = refs/heads/*:refs/heads/tt/*)?  We were
> discussing that on another thread, but I haven't found an
> implementation I'm happy with yet.

In general, no, I don't do that, for the reasons stated above --- even
publishing four branches gets to be confusing enough for people who
are looking at my tree.

I'm sure other people and other communities use git differently, so
please insert the standard disclaimer that there's more than one way
to skin a cat.

Regards,

						- Ted

  reply	other threads:[~2013-05-23 18:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  2:55 [PATCH] guilt: force the use of bare branches Theodore Ts'o
2013-05-22  3:29 ` Josef 'Jeff' Sipek
2013-05-22 12:11   ` [PATCH -v2] " Theodore Ts'o
2013-05-22 12:39     ` Per Cederqvist
2013-05-22 13:01     ` [PATCH] Added guilt.reusebranch configuration option Per Cederqvist
2013-05-22 13:42       ` Josef 'Jeff' Sipek
2013-05-22 14:45         ` Theodore Ts'o
2013-05-22 16:31           ` Josef 'Jeff' Sipek
2013-05-22 17:58           ` Junio C Hamano
2013-05-22 18:04             ` Theodore Ts'o
2013-05-22 18:55               ` Junio C Hamano
2013-05-23  2:11                 ` Theodore Ts'o
2013-05-23  9:52                   ` Ramkumar Ramachandra
2013-05-23 18:37                     ` Theodore Ts'o [this message]
2013-05-23 19:06                       ` Ramkumar Ramachandra
2013-05-23 19:14                       ` Junio C Hamano
2013-05-23 19:01                   ` Junio C Hamano

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=20130523183759.GB1275@thunk.org \
    --to=tytso@mit.edu \
    --cc=artagnon@gmail.com \
    --cc=ceder@lysator.liu.se \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffpc@josefsipek.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).