git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Ben Walton <bwalton@artsci.utoronto.ca>
Cc: git <git@vger.kernel.org>
Subject: Re: [RFD] Rewriting safety - warn before/when rewriting published history
Date: Sun, 5 Feb 2012 16:05:27 +0100	[thread overview]
Message-ID: <201202051605.28548.jnareb@gmail.com> (raw)
In-Reply-To: <1328452328-sup-6643@pinkfloyd.chass.utoronto.ca>

On Sun, 5 Feb 2012, Ben Walton wrote:
> Excerpts from Jakub Narebski's message of Sat Feb 04 14:45:53 -0500 2012:
> 
> Hi Jakub,
> 
> These items are as much about UI as anything else, I think.  UI that
> better helps users to know the state of their commits and branches can
> only be a good thing.  People that have used git for a while and are
> comfortable with it may not see the need/point of these, but I think
> they could both really help new users.

As I said, 1500+ git users would like to have such feature, according
to latest Git User's Survey.

> > In Mercurial 2.1 there are three available phases: 'public' for
> > published commits, 'draft' for local un-published commits and
> > 'secret' for local un-published commits which are not meant to be
> > published.
> 
> How do you envision such a feature in git?
> 
> A 'draft' commit (or chain of commits) could be determined from the
> push matching definitions and then marked with simple decorations in
> log output...This would extend the ability of status to note that your
> are X commits ahead of foo.  This would see any commit on a branch
> that would be pushed automatically decorated with a 'draft' status.

I think that in its basic form (treating all remotes equally) commits
in 'public' phase would be those reachable from remote-tracking branches.
Otherwise commits would be in 'draft' phase, unless explicitly marked
as 'secret' (it we implement 'secret' phase, that is).

The safety new I think of would (similarly to Mercurial phases) prevent
or warn about amending published commit, and rebasing commits which were
already published (in 'public' phase).  That would require modifications
to git-commit and git-amend, I think...

Maybe even Git could refuse or warn on the local side about non
fast-forward update of public branch, to help users of third-party tools.
 
> > While default "push matching" behavior makes it possible to have
> > "secret" commits, being able to explicitly mark commits as not for
> > publishing might be a good idea also for Git.
> 
> Do you see using configuration or convention to achieve this?
> 
> For example, any branch named private/foo could, by convention, be
> un-pushable without a force option?  Alternately, a config item
> similar to the push matching stuff to allow the users to designate
> un-pushable branches could work too.

I'm not sure, but the config item might be a good solution.  Git would
skip publishing 'secret' commits (commits from 'secret' branch) if it
would otherwise publish it due to glob refspec, and refuse (or warn)
publishing 'secret' branches explicitly.

Currently if you use default "push matching", then those branches that
you didn't push explicitly wouldn't be pushed.  But that does not prevent
pushing them by accident, and does not give UI to check if branch is
private or not (e.g. to use in git-aware shell prompt).

-- 
Jakub Narebski
Poland

  reply	other threads:[~2012-02-05 15:06 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-04 19:45 [RFD] Rewriting safety - warn before/when rewriting published history Jakub Narebski
2012-02-05 14:33 ` Ben Walton
2012-02-05 15:05   ` Jakub Narebski [this message]
     [not found] ` <CAFA910035B74E56A52A96097E76AC39@PhilipOakley>
2012-02-05 16:15   ` Jakub Narebski
2012-02-05 17:29     ` Johan Herland
2012-02-05 20:46       ` Jakub Narebski
2012-02-05 22:49         ` Johan Herland
2012-02-06 14:44           ` Jakub Narebski
2012-02-06 15:59             ` Johan Herland
2012-02-06 17:14               ` Jakub Narebski
2012-02-06 20:16                 ` Johan Herland
2012-02-07 14:31                   ` Jakub Narebski
2012-02-07 15:09                     ` Johan Herland
2012-02-10 19:38                       ` Jakub Narebski
2012-02-10 20:19                         ` Philip Oakley
2012-02-11 13:10                         ` Johan Herland
2012-02-11 13:45                           ` Jakub Narebski
2012-02-20 21:07                             ` [RFC] pre-rebase: Refuse to rewrite commits that are reachable from upstream Johan Herland
2012-02-20 21:21                               ` Johan Herland
2012-02-20 22:43                               ` Junio C Hamano
2012-02-21  0:03                                 ` Johan Herland
2012-02-21  7:44                                   ` Junio C Hamano
2012-02-21 23:23                                     ` Johan Herland
2012-02-21 23:43                                       ` Junio C Hamano
2012-02-21 23:59                                         ` Dave Zarzycki
2012-02-22  7:09                                           ` Jeff King
2012-02-22  8:00                                             ` Dave Zarzycki
2012-04-07 15:01                           ` [RFD] Rewriting safety - warn before/when rewriting published history Steven Michalske
2012-04-07 14:49                       ` Steven Michalske
2012-02-07 17:27                     ` Ronan Keryell
2012-02-06  0:57 ` Steven Michalske
2012-02-06  6:53   ` Johan Herland
2012-02-06 13:45   ` Jakub Narebski
2012-04-07 14:36     ` Steven Michalske

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=201202051605.28548.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=bwalton@artsci.utoronto.ca \
    --cc=git@vger.kernel.org \
    /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).