git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: An alternate model for preparing partial commits
@ 2008-06-28  9:30 Stephen R. van den Berg
  0 siblings, 0 replies; 57+ messages in thread
From: Stephen R. van den Berg @ 2008-06-28  9:30 UTC (permalink / raw)
  To: David Jeske; +Cc: Stephen Sinclair, Git Mailing List

David Jeske wrote:
>- I could supercede 2-commits with 1, effectively making the bad-commit
>disappear in the linear history. Users who already have the history, however,
>would be unaffected, because the start/end endpoints are the same.

Superseding does not work in git trees and is a disruptive operation to
*all* commits following the point being superseded.
Also, superseding preserves the startpoint, but *always* alters the
endpoint.

I suggest you take a look at how a git-repository is stored and learn
about how the SHA1-hashes interact with the stored repository.
-- 
Sincerely,
           Stephen R. van den Berg.

Heisenberg might have been here.

^ permalink raw reply	[flat|nested] 57+ messages in thread
* Re: An alternate model for preparing partial commits
@ 2008-06-28  1:23 Theodore Tso
  0 siblings, 0 replies; 57+ messages in thread
From: Theodore Tso @ 2008-06-28  1:23 UTC (permalink / raw)
  To: David Jeske; +Cc: Jakub Narebski, git

On Fri, Jun 27, 2008 at 08:51:41PM -0000, David Jeske wrote:
> -- Jakub Narebski wrote:
> > git rebase --interactive?
> > Any patch management interface (StGIT, Guilt)?
> 
> Yes, as I said, that set of operations can be performed with git today.
> 
> What git can't do, is let me "supercede" the old DAG-subset, so
> people I shared them with can get my new changes without hurting
> their world. Currently git seems to rely on the idea that "if you
> accept changes into your tree that will be later rebased, it's up to
> you to figure it out". I don't see why that is the case

Because it's fundamentally hard and fraught with danger --- especially
since with git-rebase --interactive you actually can *edit* an
intervening patch, so commits that are based off of a rebased branch
have absolutely no guarantee of correctly applying against the rebased
branch.

If they do apply cleanly, you can use git rebase --onto, but the
possibility of merge conflicts are endless.

The general workflow here is that you simply don't share your git
state until it's been refactored and you're positive that it you've
gotten it right.  Or if you do share, it you do so in a branch where
you tell people --- don't base work off of this!  (i.e., a "pu" branch
like git has.)

As I said earlier, premature sharing is highly over-rated.  And having
people develop against an unstable branch is just extra work for them
anyway.  So commit frequently, and if you want to backup your local
hard drive, push regularly to your own private git repository located
off-machine.  Just don't ask people base any branches off your private
branch until you're ready to publish it in a form after which you
don't do rebase operations.  This works quite well for many projects
and many developers.

						- Ted

^ permalink raw reply	[flat|nested] 57+ messages in thread
* Re: An alternate model for preparing partial commits
@ 2008-06-28  1:17 Theodore Tso
  2008-06-28  1:56 ` Miklos Vajna
  0 siblings, 1 reply; 57+ messages in thread
From: Theodore Tso @ 2008-06-28  1:17 UTC (permalink / raw)
  To: David Jeske; +Cc: Robert Anderson, Git Mailing List

On Fri, Jun 27, 2008 at 08:29:15PM -0000, David Jeske wrote:
> git has all the concepts I want except one. However, it makes the process
> pretty manual. Here is an idea about automating it. I'll talk about that one
> new concept at the bottom.
> 
> I think of this as reorder/merge/split...
> 
> reorder: Picture that a list of commits on this branch opens in an
> editor. You are free to rearrange the lines in any order you want,
> but you have to keep all the lines. When you are done reordering the
> lines, the tool creates a new topic branch and applies the changes
> (probably with cherrypick) to the new topic branch. If there are no
> conflicts, you're done.....

Read the man page for for "git rebase --interactive".  I think you
will find that it handles reording and merging (its called squashing)
already.

Splitting patches is harder to do and probably is one of the things
you have to do manually.

						- Ted

^ permalink raw reply	[flat|nested] 57+ messages in thread
* An alternate model for preparing partial commits
@ 2008-06-27  6:50 Robert Anderson
  2008-06-27  7:10 ` Björn Steinbrink
                   ` (4 more replies)
  0 siblings, 5 replies; 57+ messages in thread
From: Robert Anderson @ 2008-06-27  6:50 UTC (permalink / raw)
  To: Git Mailing List

Seems to me the concept of the "index" is a half-baked version of what
I really want, which is the ability to factor a working tree's changes
into its constituent parts in preparation for committing them.  The
index provides some very nice facilities to factor out changes in a
working tree into a "staging area", but the fundamental flaw of this
in my view is that this "staging area" is not instantiated as a tree,
so it cannot be compiled and/or tested before committing.

Consider a facility where the state you want to commit next is built
up in the current working directory, and the original set of changes
exists in some proto-space like the index currently inhabits, where
you can query and manipulate that state, but it isn't instantiated in
your working tree.

Imagine a session like this:

You've got a couple of conflated changes in your working tree, that
you think you can break up into two orthogonal changes, each of which
will compile and pass a set of tests you've got.  You think.  You'd
like to verify the build and test before you commit each piece.

git prep

where "prep" means "prepare commit".  Don't get hung up on command or
option names I'm using as placeholders, I just made that up without
much deep thought about what to call it.

Now my tree appears clean (and git diff returns nothing).  I can now
start adding the changes I had in my working tree that I want to
include in the next commit, using git add (which would know I am in
the "prep" mode).  I can examine those original working dir changes I
am choosing from with:

git diff --prep

which, at this point, shows the same output that "git diff" did before
I ran "git prep."  Now I want to add some subset of my original
changes:

git add newfile.c
git add -i
<add a couple of hunks of the changes from file modfile.c>

Now I have a working tree state that I think I want to commit.  I can
examine it with:

git diff

and I can compile and test it.  Yep, it works and passes my test suite
(an option I did not have if I had added these changes to the index).
So now I want to commit:

git commit -a -m "made change A"

I think the commit should probably "pop" the rest of the changes I did
not commit back into the working directory.  If I want to pull another
subset of changes again, I can repeat the process with another "git
prep".

Does this idea resonate with anyone else?

Thanks,
Bob Anderson

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

end of thread, other threads:[~2008-07-08  5:00 UTC | newest]

Thread overview: 57+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-28  9:30 An alternate model for preparing partial commits Stephen R. van den Berg
  -- strict thread matches above, loose matches on Subject: below --
2008-06-28  1:23 Theodore Tso
2008-06-28  1:17 Theodore Tso
2008-06-28  1:56 ` Miklos Vajna
2008-06-27  6:50 Robert Anderson
2008-06-27  7:10 ` Björn Steinbrink
2008-06-27 16:54   ` Robert Anderson
2008-06-27 17:27     ` Björn Steinbrink
2008-06-27 17:34       ` Robert Anderson
2008-06-27  8:35 ` Johannes Sixt
2008-06-27 17:01   ` Robert Anderson
2008-06-27  8:50 ` Petr Baudis
2008-06-27 17:02   ` Robert Anderson
2008-06-27 13:33 ` Johannes Schindelin
2008-06-27 13:49   ` Miklos Vajna
2008-06-27 17:14   ` Robert Anderson
2008-06-27 17:45     ` Johannes Schindelin
2008-06-27 17:49       ` Robert Anderson
     [not found]         ` <alpine.DEB.1.00.0806271854120.9925@racer>
2008-06-27 18:07           ` Robert Anderson
2008-06-27 18:20         ` Dana How
2008-06-27 20:31     ` Stephen Sinclair
     [not found]       ` <willow-jeske-01l7H4tHFEDjCgPV-01l7ZhB8FEDjCdJs>
2008-06-27 20:45         ` David Jeske
2008-06-28 17:23           ` Wincent Colaiuta
2008-06-27 20:45         ` David Jeske
2008-06-28  2:14     ` Dmitry Potapov
2008-06-28  2:57       ` Robert Anderson
2008-06-28  4:03         ` Dmitry Potapov
     [not found]           ` <9af502e50806272320p23f01e8eo4a67c5f6f4476098@mail.gmail.com>
     [not found]             ` <20080628123522.GL5737@dpotapov.dyndns.org>
2008-06-28 15:53               ` Robert Anderson
2008-06-28 16:52                 ` Dmitry Potapov
2008-06-27 18:15   ` Junio C Hamano
2008-06-27 18:43     ` Robert Anderson
2008-06-28  5:03     ` Jeff King
2008-06-28  7:03       ` Robert Anderson
2008-06-28  8:53         ` Jeff King
2008-06-28 21:53           ` Junio C Hamano
2008-06-28 14:51       ` Johannes Schindelin
2008-07-08  4:58         ` Jeff King
     [not found] ` <willow-jeske-01l7H4tHFEDjCgPV-01l7H4sOFEDjCbyi>
2008-06-27 20:29   ` David Jeske
2008-06-27 20:47     ` Jakub Narebski
     [not found]       ` <willow-jeske-01l7H4tHFEDjCgPV-01l7[1OFFEDjCYJV>
2008-06-27 20:51         ` David Jeske
2008-06-27 20:51         ` David Jeske
     [not found]       ` <-8386235276716376372@unknownmsgid>
2008-06-27 22:55         ` Robert Anderson
2008-06-27 23:14           ` Junio C Hamano
2008-06-28  0:08             ` Robert Anderson
2008-06-28  2:57               ` Dmitry Potapov
2008-06-28  3:31                 ` Robert Anderson
2008-06-28 14:34               ` Stephen Sinclair
2008-06-28 16:00                 ` Robert Anderson
2008-06-28 16:30                 ` Robert Anderson
2008-06-28 17:12                   ` Jakub Narebski
2008-06-28 18:25                     ` Robert Anderson
     [not found]                       ` <willow-jeske-01l7H4tHFEDjCgPV-01l82hwbFEDjCX70>
2008-06-28 19:12                         ` David Jeske
2008-06-28 19:12                         ` David Jeske
2008-06-28 19:13                   ` Stephen Sinclair
     [not found]           ` <willow-jeske-01l7H4tHFEDjCgPV-01l7buicFEDjCagd>
2008-06-28  0:22             ` David Jeske
2008-06-28  0:22             ` David Jeske
2008-06-27 20:29   ` David Jeske

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