git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH 2/1] fixup! Documentation: start to explain what git replace is for

From
MMaaartin-1 <grajcar1@seznam.cz>
Date
Jan 15, 2011, 00:04 UTC
Message-ID
<4D30E48C.4060400@seznam.cz>
In-Reply-To
<201101142348.31647.jnareb@gmail.com>
On 11-01-14 23:48, Jakub Narebski wrote:
> On Fri, 14 Jan 2011, Maaartin-1 wrote:
>> On 11-01-14 09:49, Jonathan Nieder wrote:
>>> Some tweaks suggested by Maaartin:
Show 11 quoted lines
>>> [side note: please do not prune the cc list; I only stumbled on this
>>> message in the online archive by luck]
>>
>> What could I have done about it? I didn't received it by email and
>> answered using post.gmane.org. There's no way to add CC there. If I'd
>> wrote an email instead, it wouldn't be placed in the thread.
> 
> In a good newsreader, like e.g. Gnus from GNU Emacs, you have option
> to do 'reply all via email', which includes also git@vger.kernel.org,
> i.e. mailing list from which gmane newsgroup is created.  That's what
> I do nowadays (usually).

I hate using Emacs for too many things. However, I'm starting to use Thunderbird as newsreader, and it's quite OK.

Show 6 quoted lines
>> I'd go the other way round and use "-i" so I'd need only one file. Using
>> a shell variable instead would be even better, s. below.
> 
> No, using shell variable for storing commit object is *not* a good idea.
> Either save it to temporary file, where you can edit it using editor of
> your choice, or use pipeline.

I see that the line-breaks get (for whatever reason) replaced by blanks, sorry for the noise.

Show 11 quoted lines
>>> +$ sed "/^tree / a \\
>>> +parent $(git rev-parse v2.4)" <tmp >new                <4>
>>
>> $ first_commit = $($ echo $first_commit |
>> sed  "/^tree / a \\
>> parent $(git rev-parse v2.4)")                      <4>
>>
>> Unfortunately, the line got too long. For sed unaware people like me it
>> may not be obvious that a line break is required.
> 
> No, it is not required, I think.
You're right, sorry again.
Show 8 quoted lines
> If you don't use temporary file, which you can edit, you can use pipeline
> instead:
> 
>   $ new_commit=$(git cat-file commit $first_commit |
>                  sed -e "/^tree / a\\parent $(git rev-parse v2.4)" |
>                  git hash-object -t commit -w --stdin
> 
>   $ git replace $first_commit $new_commit

I know, I just thought, using such a pipe is not very enlightening, but it's actually quite easy to follow.

Previous: Jakub Narebski
Message 18 of 18 in “Merge two different repositories (v2.4 + v2.5) into the one (v2.4 -> v2.5). Possible?”
  1. Алексей ШумкинJan 11, 2011
  2. Martin KrügerJan 11, 2011
  3. Re[2]: Merge two different repositories (v2.4 + v2.5) into the one (v2.4 -> v2.5). Possible?Алексей Шумкин, Jan 11, 2011
  4. Andreas EricssonJan 11, 2011
  5. Re[2]: Merge two different repositories (v2.4 + v2.5) into the one (v2.4 -> v2.5). Possible?Алексей Шумкин, Jan 11, 2011
  6. Martin KrügerJan 11, 2011
  7. Jakub NarebskiJan 11, 2011
  8. Re[2]: Merge two different repositories (v2.4 + v2.5) into the one (v2.4 -> v2.5). Possible?Алексей Шумкин, Jan 11, 2011
  9. Re[2]: Merge two different repositories (v2.4 + v2.5) into the one (v2.4 -> v2.5). Possible?Алексей Шумкин, Jan 11, 2011
  10. Documentation: start to explain what git replace is forJonathan Nieder, Jan 12, 2011
  11. MaaartinJan 12, 2011
  12. Alexey ShumkinJan 13, 2011
  13. 2/1 fixup! Documentation: start to explain what git replace is forJonathan Nieder, Jan 14, 2011
  14. Maaartin-1Jan 14, 2011
  15. Jonathan NiederJan 14, 2011
  16. how multiple roots happen (Re: [RFC/PATCH 2/1] fixup! Documentation: start to explain what git replace is for)Jonathan Nieder, Jan 14, 2011
  17. Jakub NarebskiJan 14, 2011
  18. Maaartin-1Jan 15, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.