From: Junio C Hamano <junkio@cox.net>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: git@vger.kernel.org
Subject: Re: What's in git.git
Date: Thu, 09 Feb 2006 16:35:44 -0800 [thread overview]
Message-ID: <7v3bis59un.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7v8xsk5a6k.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Thu, 09 Feb 2006 16:28:35 -0800")
Junio C Hamano <junkio@cox.net> writes:
> "Luck, Tony" <tony.luck@intel.com> writes:
>
>> Looks very close to what I want.
>>
>>> git checkout topic
>>> git format-patch --stdout origin > topic-diff
>>
>> topic-diff contains each commit as a separate message
>>
>>> $VISUAL topic-diff
>>> # Fix comments
>>
>> so this needs some skill & care to rearrange the pieces
>> and end up with legal input to git-am
>>
>> Perhaps I'd like to have:
>>
>> git diff SHA-where-I-branched..HEAD
>>
>> but I don't see the way to compute the SHA-where-I-branched
>>
>> -Tony
>
> If what you want to end up with is a single commit, that is
> easy.
>
> If your topic branch is only "fork from master and never
> re-merge with master but just pile new commits on top of the
> tip, single strand of pearls" kind,
>
> git-merge-base master topic
>
> would find the 'x' commit, where you forked from:
>
> "master"
> ---x---o---o---o---o
> \
> o---o---o---o
> "topic"
>
> If you have "my topic will conflict with a change recently done
> in master so let's merge up from master to resolve conflict
> before going further" kind of merge commit on your topic branch,
> then you cannot have a single two-tree diff easily anyway, but
> in such a case, the following steps would work.
>
> "master"
> ---o---o---o---o---o
> \ \
> o---o---*---o
> "topic"
>
> (1) First merge "master" into "topic":
>
> $ git checkout topic
> $ git pull . master
>
> "master"
> ---o---o---o---o---o
> \ \ \
> o---o---*---o---*
> "topic"
>
> which would give you the rightmost '*' merge.
>
> (2) Extract diff from "master" to '*':
>
> $ git diff HEAD^2 HEAD >P.diff
>
> HEAD^1 is previous "topic" head and HEAD^2 is what you
> merged ("master").
>
> (3) Pick commits only on "topic" branch but not on "master"
>
> $ git rev-list --pretty --no-merges master..topic >P.log
>
> This will pick up the three 'o' commits on the lower
> development track and show their commit log message.
>
>
> (4) Reset the "topic" branch to "master", and do the squashed
> commit:
>
> $ git reset --hard master
> $ git apply --index P.diff
> $ git commit -F P.log -e
>
> This obviously would work equally well for single strand of
> pearls case. Maybe you can package the above up, and send in a
> patch to add "git-squash" command?
I am stupid. (4) can be done a lot more easily. Do not do step
(2) -- you do not need a diff at all. But do do step (3) to get
the logs. Then:
$ git reset --soft master
$ git commit -F P.log -e
What --soft reset does is to keep the index and the working tree
as is, but just change the current branch head to point at the
named commit. So, immediately after the above soft reset, your
commit ancestry graph looks like this:
"master"
---o---o---o---o---o
"topic"
and the last commit finally would give you:
"master"
---o---o---o---o---o
\
o
"topic"
next prev parent reply other threads:[~2006-02-10 0:35 UTC|newest]
Thread overview: 240+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-09 23:49 What's in git.git Luck, Tony
2006-02-10 0:28 ` Junio C Hamano
2006-02-10 0:35 ` Junio C Hamano [this message]
2006-02-14 23:10 ` Luck, Tony
2006-02-10 0:40 ` Ryan Anderson
2006-02-10 0:46 ` Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2008-01-30 8:32 What's in git.git (stable frozen) Junio C Hamano
2008-02-12 7:25 ` What's in git.git Junio C Hamano
2008-02-12 9:15 ` Daniel Stenberg
2008-02-12 9:47 ` Mike Hommey
2008-02-12 11:35 ` Daniel Stenberg
2007-05-13 22:30 What's in git.git (stable) Junio C Hamano
2007-05-17 0:21 ` Junio C Hamano
2007-05-19 5:24 ` Junio C Hamano
2007-05-23 21:46 ` Junio C Hamano
2007-05-29 10:12 ` Junio C Hamano
2007-06-02 21:09 ` Junio C Hamano
2007-06-07 2:08 ` Junio C Hamano
2007-06-13 20:11 ` Junio C Hamano
2007-06-21 7:21 ` Junio C Hamano
2007-06-25 9:43 ` Junio C Hamano
2007-07-02 0:16 ` Junio C Hamano
2007-07-13 6:06 ` What's in git.git Junio C Hamano
2006-11-25 10:12 Junio C Hamano
2006-11-28 19:23 ` Carl Worth
2006-11-29 10:21 ` Johannes Schindelin
2006-11-23 2:49 Junio C Hamano
2006-11-18 22:24 Junio C Hamano
2006-11-18 23:14 ` Junio C Hamano
2006-11-19 15:17 ` Johannes Schindelin
2006-11-19 15:45 ` Jakub Narebski
2006-11-19 16:30 ` Johannes Schindelin
2006-11-19 18:31 ` Jakub Narebski
2006-11-19 19:06 ` Johannes Schindelin
2006-11-19 17:01 ` Petr Baudis
2006-11-12 6:07 Junio C Hamano
2006-11-08 3:21 Junio C Hamano
2006-11-08 4:13 ` David Lang
2006-11-09 2:28 ` Horst H. von Brand
2006-11-09 2:54 ` Junio C Hamano
2006-11-09 3:04 ` Junio C Hamano
2006-11-09 3:45 ` Dave Dillow
2006-11-12 22:25 ` Johannes Schindelin
2006-11-08 7:40 ` Jakub Narebski
2006-11-08 7:59 ` Junio C Hamano
2006-11-08 7:58 ` Jakub Narebski
2006-11-08 8:26 ` Junio C Hamano
2006-11-08 14:51 ` Petr Baudis
2006-11-09 0:02 ` Junio C Hamano
2006-11-02 0:53 Junio C Hamano
2006-11-02 10:02 ` Johannes Schindelin
2006-11-05 17:24 ` Rene Scharfe
2006-11-05 18:47 ` Junio C Hamano
2006-10-26 8:47 Junio C Hamano
2006-10-26 9:12 ` Jakub Narebski
2006-10-26 9:24 ` Junio C Hamano
2006-10-26 12:08 ` Petr Baudis
2006-10-26 12:17 ` Jakub Narebski
2006-10-26 9:19 ` Jakub Narebski
2006-10-27 1:10 ` Petr Baudis
2006-10-26 12:22 ` Petr Baudis
2006-10-26 17:27 ` Andy Whitcroft
2006-10-24 6:32 Junio C Hamano
2006-10-19 5:58 Junio C Hamano
2006-10-17 7:44 Junio C Hamano
2006-10-17 17:16 ` Linus Torvalds
2006-10-17 18:15 ` Davide Libenzi
2006-10-17 18:19 ` Junio C Hamano
2006-10-17 18:53 ` Linus Torvalds
2006-10-17 18:57 ` Andy Whitcroft
2006-10-06 0:59 Junio C Hamano
2006-09-28 7:39 Junio C Hamano
2006-09-28 9:36 ` Petr Baudis
2006-09-28 13:27 ` Johannes Schindelin
2006-09-29 7:34 ` Junio C Hamano
2006-09-29 8:32 ` Petr Baudis
2006-09-30 7:31 ` Junio C Hamano
2006-09-29 8:09 ` Junio C Hamano
2006-09-11 2:21 Junio C Hamano
2006-09-11 11:29 ` Jakub Narebski
2006-09-11 16:31 ` Junio C Hamano
2006-09-11 21:06 ` Jakub Narebski
2006-09-11 22:14 ` Petr Baudis
2006-09-11 23:48 ` Junio C Hamano
2006-09-18 5:33 ` Junio C Hamano
2006-09-18 5:39 ` Jakub Narebski
2006-09-18 5:50 ` Junio C Hamano
2006-09-18 6:07 ` Jakub Narebski
2006-09-18 8:11 ` Johannes Schindelin
2006-09-18 8:19 ` Junio C Hamano
2006-09-18 5:48 ` Jakub Narebski
2006-09-18 14:23 ` Franck Bui-Huu
2006-09-24 10:37 ` Junio C Hamano
2006-08-28 7:19 Junio C Hamano
2006-08-17 6:45 Junio C Hamano
2006-08-14 2:30 Junio C Hamano
2006-08-14 8:11 ` Alex Riesen
2006-08-04 10:12 Junio C Hamano
2006-08-04 10:27 ` Jakub Narebski
2006-08-04 18:40 ` Johannes Schindelin
2006-08-04 18:55 ` Jakub Narebski
2006-08-04 19:09 ` Junio C Hamano
2006-08-04 19:50 ` Junio C Hamano
2006-08-04 20:06 ` Junio C Hamano
2006-08-04 20:27 ` Jakub Narebski
2006-08-01 23:54 Junio C Hamano
2006-08-02 0:34 ` Johannes Schindelin
2006-08-02 7:41 ` Junio C Hamano
2006-08-02 14:02 ` Alex Riesen
2006-08-03 4:56 ` Junio C Hamano
2006-08-03 8:09 ` Alex Riesen
2006-08-03 9:16 ` Junio C Hamano
2006-08-03 12:32 ` Alex Riesen
2006-08-03 12:35 ` Alex Riesen
2006-08-02 19:29 ` carbonated beverage
2006-08-03 4:52 ` Junio C Hamano
2006-08-03 5:15 ` A Large Angry SCM
2006-08-03 5:30 ` carbonated beverage
2006-08-03 5:48 ` carbonated beverage
2006-08-03 7:36 ` carbonated beverage
2006-08-03 7:37 ` carbonated beverage
2006-08-03 8:39 ` Junio C Hamano
2006-08-03 8:50 ` carbonated beverage
2006-08-03 9:31 ` carbonated beverage
2006-08-03 9:03 ` Jakub Narebski
2006-07-17 8:29 Junio C Hamano
2006-07-08 0:37 Junio C Hamano
2006-07-08 2:28 ` Johannes Schindelin
2006-07-08 21:28 ` Jakub Narebski
2006-07-02 7:45 Junio C Hamano
2006-06-29 6:41 Junio C Hamano
2006-06-25 9:37 Junio C Hamano
2006-06-25 17:47 ` Linus Torvalds
2006-06-25 18:07 ` Timo Hirvonen
2006-06-25 18:43 ` Linus Torvalds
2006-06-27 5:54 ` Junio C Hamano
2006-06-27 6:29 ` Linus Torvalds
2006-06-27 7:55 ` Johannes Schindelin
2006-06-26 22:24 ` Martin Langhoff
2006-06-18 0:48 Junio C Hamano
2006-06-18 12:26 ` Johannes Schindelin
2006-06-18 13:08 ` Petr Baudis
2006-06-18 18:43 ` Johannes Schindelin
2006-06-19 7:34 ` Junio C Hamano
2006-06-19 8:35 ` Johannes Schindelin
2006-05-29 6:44 Junio C Hamano
2006-05-24 22:40 Junio C Hamano
2006-05-21 19:01 Junio C Hamano
2006-05-16 5:30 Junio C Hamano
2006-05-10 3:11 Junio C Hamano
2006-05-10 3:48 ` Linus Torvalds
2006-05-10 4:21 ` Linus Torvalds
2006-05-10 4:26 ` Linus Torvalds
2006-05-10 4:41 ` Junio C Hamano
2006-05-10 4:51 ` Linus Torvalds
2006-05-10 4:36 ` Randal L. Schwartz
2006-05-10 4:45 ` Linus Torvalds
2006-05-10 14:15 ` Nicolas Pitre
2006-05-10 15:00 ` Alex Riesen
2006-05-10 16:48 ` Linus Torvalds
2006-05-10 5:05 ` Junio C Hamano
2006-05-10 5:34 ` Martin Langhoff
2006-05-10 6:48 ` Jakub Narebski
2006-05-04 8:14 Junio C Hamano
2006-05-04 9:06 ` Petr Baudis
2006-05-03 18:54 Junio C Hamano
2006-04-26 11:09 Junio C Hamano
2006-04-22 0:52 Junio C Hamano
2006-04-22 11:25 ` Johannes Schindelin
2006-04-14 7:49 Junio C Hamano
2006-04-18 8:44 ` Junio C Hamano
2006-04-11 4:40 Junio C Hamano
2006-04-11 13:50 ` Linus Torvalds
2006-04-11 15:55 ` Petr Baudis
2006-04-11 17:58 ` Junio C Hamano
2006-04-04 23:06 Junio C Hamano
2006-03-28 0:28 Junio C Hamano
2006-03-26 6:00 Junio C Hamano
2006-03-22 1:58 Junio C Hamano
2006-03-22 2:18 ` Randal L. Schwartz
2006-03-22 3:26 ` Randal L. Schwartz
2006-03-22 5:07 ` Junio C Hamano
2006-03-22 5:35 ` Randal L. Schwartz
2006-03-22 5:46 ` Junio C Hamano
2006-03-22 16:21 ` Linus Torvalds
2006-03-22 10:21 ` Bertrand Jacquin
2006-03-22 11:52 ` Petr Baudis
2006-03-22 19:15 ` Junio C Hamano
2006-03-15 22:13 Junio C Hamano
2006-03-07 22:23 Francis Daly
2006-03-06 7:13 Junio C Hamano
2006-03-06 9:05 ` Martin Langhoff
2006-03-10 10:44 ` Fredrik Kuivinen
2006-03-10 11:17 ` Johannes Schindelin
2006-03-10 11:59 ` Martin Langhoff
2006-03-13 5:01 ` Junio C Hamano
2006-03-06 9:15 ` Johannes Schindelin
2006-03-06 10:29 ` Lukas Sandström
2006-03-05 4:22 Junio C Hamano
2006-03-05 4:51 ` Junio C Hamano
2006-03-05 4:58 ` Linus Torvalds
2006-03-05 5:44 ` Junio C Hamano
2006-03-05 17:53 ` Linus Torvalds
2006-03-05 18:29 ` Linus Torvalds
2006-03-05 19:36 ` Junio C Hamano
2006-03-05 20:04 ` Linus Torvalds
2006-03-05 19:53 ` Junio C Hamano
2006-03-05 9:21 ` Martin Langhoff
2006-03-05 9:58 ` Alexandre Julliard
2006-03-05 10:15 ` Martin Langhoff
2006-03-05 10:47 ` Alexandre Julliard
2006-03-05 10:10 ` Junio C Hamano
2006-03-01 12:24 Junio C Hamano
2006-03-01 21:28 ` Nicolas Pitre
2006-03-01 22:51 ` Junio C Hamano
2006-03-01 23:01 ` Luck, Tony
2006-02-23 2:05 Junio C Hamano
2006-02-22 10:45 Junio C Hamano
2006-02-22 13:46 ` Alex Riesen
2006-02-20 7:57 Junio C Hamano
2006-02-20 8:34 ` Andreas Ericsson
2006-02-20 9:04 ` Junio C Hamano
2006-02-20 9:47 ` Junio C Hamano
2006-02-19 8:56 Junio C Hamano
2006-02-17 14:28 linux
2006-02-18 6:49 ` Junio C Hamano
2006-02-16 6:57 Junio C Hamano
2006-02-10 17:03 Luck, Tony
2006-02-09 6:47 Junio C Hamano
[not found] ` <20060209030905.319f2e48.seanlkml@sympatico.ca>
2006-02-09 8:09 ` sean
2006-02-09 9:04 ` Andreas Ericsson
[not found] ` <20060209044039.45763d4f.seanlkml@sympatico.ca>
2006-02-09 9:40 ` sean
2006-02-09 9:55 ` Junio C Hamano
2006-02-09 10:29 ` Andreas Ericsson
2006-02-09 10:55 ` Junio C Hamano
2006-02-09 11:35 ` Andreas Ericsson
2006-02-10 0:47 ` Junio C Hamano
2006-02-09 9:58 ` Johannes Schindelin
2006-02-09 10:32 ` Junio C Hamano
2006-02-09 11:24 ` Johannes Schindelin
2006-02-09 23:14 ` Tony Luck
2006-02-09 23:30 ` Ryan Anderson
2006-02-09 23:44 ` Junio C Hamano
2006-02-10 15:02 ` Junio C Hamano
2006-01-28 21:08 Junio C Hamano
2006-01-25 13:00 Junio C Hamano
[not found] ` <8aa486160601250741k120f0021h@mail.gmail.com>
2006-01-25 19:24 ` Junio C Hamano
2006-01-25 20:36 ` Jason Riedy
[not found] ` <8aa486160601250634v294857e0j@mail.gmail.com>
2006-01-25 23:56 ` Junio C Hamano
[not found] ` <8aa486160601260104v745594d9m@mail.gmail.com>
[not found] ` <7vk6cngwfh.fsf@assigned-by-dhcp.cox.net>
[not found] ` <8aa486160601260156h6157ca34s@mail.gmail.com>
2006-01-26 12:12 ` Junio C Hamano
2006-01-26 16:24 ` Santi Bejar
2006-01-20 8:42 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=7v3bis59un.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=tony.luck@intel.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).