git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: Alex Riesen <raa.lkml@gmail.com>
Cc: Bill Lear <rael@zopyra.com>, git@vger.kernel.org
Subject: Re: pull into dirty working tree
Date: Wed, 13 Jun 2007 15:01:22 -0700	[thread overview]
Message-ID: <86k5u7zf7x.fsf@blue.stonehenge.com> (raw)
In-Reply-To: <20070613213931.GD3412@steel.home> (Alex Riesen's message of "Wed, 13 Jun 2007 23:39:31 +0200")

>>>>> "Alex" == Alex Riesen <raa.lkml@gmail.com> writes:

Alex> You left the process of figuring out what files should be temporarily
Alex> added to the index. _Automatically_. Because that's what you need if
Alex> you want "git pull" to just work. Otherwise it just fails.

I'd just commit *all* of it in my scenerio.  There won't be any *other* files.
And because of the final git-reset --soft and git-reset, it won't matter if I
commited more than I'd ever commit on the final hit.

The result of my sequence (I believe) is that my topic commits will appear
rebased on top of the new upstream, and that I'll have a dirty working
directory that represents things as they were, ready for the next commit.

I *lose* the idea of what files were partially added before the last commit,
but I can always reconstruct that by hand, because I should already be
thinking about that before the next commit.

Using those famous trees, if I start with:

A--B--C--D origin
         --E--F--G my_topic
                 --(X) dirty tree

and upstream commits P Q R, the result will be:

A--B--C--D--P--Q--R origin
                  --E'--F'--G' (E, F, G rebased and merged) my_topic
                            --(X') dirty tree rebased

This works because I temporarily make H, which follows E, F, G
and then rebase E-F-G-H onto origin,
and then simply "uncommit" H'.

Oops.  I see the problem.  I don't need the "WIP" tag.  I want to uncommit to
G' not to G.  Is that what you were referencing?

In which case, it's even simpler:

git-add . # add *everything* that's not .gitignored
git-commit -a -m WIP # save for replay (H above)
git-fetch origin # get upstream (P Q R)
git-rebase origin # creates E' F' G' H'
git-reset --soft HEAD^ # back up to G'
git-reset # mark everything un-added as of G'

Yeah, this is far easier.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

  reply	other threads:[~2007-06-13 22:01 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-13 14:14 pull into dirty working tree Bill Lear
2007-06-13 14:38 ` Pierre Habouzit
2007-06-13 14:43   ` Pierre Habouzit
2007-06-13 14:47     ` Pierre Habouzit
2007-06-13 14:45   ` Bill Lear
2007-06-13 14:53     ` Pierre Habouzit
2007-06-13 15:01 ` Randal L. Schwartz
2007-06-13 19:28   ` Alex Riesen
2007-06-13 19:32     ` Randal L. Schwartz
2007-06-13 20:47       ` Alex Riesen
2007-06-13 20:52         ` Randal L. Schwartz
2007-06-13 21:39           ` Alex Riesen
2007-06-13 22:01             ` Randal L. Schwartz [this message]
2007-06-13 22:27               ` Alex Riesen
2007-06-13 15:01 ` Johannes Schindelin
2007-06-13 15:40   ` Andy Parkins
2007-06-13 15:54     ` Johannes Schindelin
2007-06-13 15:56     ` Bill Lear
2007-06-13 16:07       ` Johannes Schindelin
2007-06-13 16:30         ` Bill Lear
2007-06-13 17:13   ` Junio C Hamano
2007-06-14  4:22 ` Daniel Barkalow
2007-06-14  5:21 ` Linus Torvalds
2007-06-14  7:49   ` Junio C Hamano
2007-06-14  8:01     ` Raimund Bauer
2007-06-14  8:06     ` Steven Grimm
2007-06-14 14:25       ` Nicolas Pitre
2007-06-14 12:46   ` Bill Lear
2007-06-14 15:46     ` Linus Torvalds
2007-06-14 20:20       ` Olivier Galibert
2007-06-14 20:30         ` Linus Torvalds
2007-06-15  0:46       ` Martin Langhoff
2007-06-15  1:07         ` Linus Torvalds
2007-06-15  3:33           ` Martin Langhoff
2007-06-15 18:26             ` Robin Rosenberg
  -- strict thread matches above, loose matches on Subject: below --
2007-06-13 15:03 MichaelTiloDressel
2007-06-13 15:36 ` Bill Lear
2007-06-13 17:31   ` Michael Dressel
2007-06-13 18:12     ` Bill Lear
2007-06-13 18:30       ` Johannes Schindelin
2007-06-13 18:56         ` Bill Lear
2007-06-13 20:17           ` Robin Rosenberg
2007-06-13 23:32             ` Johannes Schindelin

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=86k5u7zf7x.fsf@blue.stonehenge.com \
    --to=merlyn@stonehenge.com \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@gmail.com \
    --cc=rael@zopyra.com \
    /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).