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

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

From
MMaaartin <grajcar1@seznam.cz>
Date
Jan 12, 2011, 22:47 UTC
Message-ID
<loom.20110112T232501-316@post.gmane.org>
In-Reply-To
<20110112000812.GA31950@burratino>
Jonathan Nieder <jrnieder <at> gmail.com> writes:
> +. The following example comes from ??????? ??????:

I know unicode exists already for many years, but in cygwin I get just a bunch of question marks instead of the name. So I'd suggest to replace "Алексей Шумкин" by "Alexej Shumkin" or whatever his preferred transcription is.

> +<1> Find all parentless commits in the 'master' branch;
> +for 'master' read the branch holding v2.5 history.
Aren't you later calling it "FIRST" and assuming there's only one?
> +$ sed -i "/^tree / a \\
> +parent $(git rev-parse v2.4)" <tmp >new          <4>

Isn't the combination of "-i" (=in-place edit) with redirection wrong? I hardly know anything about sed (abandoned it in favor of perl many years ago).

> +$ git hash-object -t commit -w new               <5>
> +$ git replace FIRST <object id from hash-object> <6>
I'd prefer something like

+$ objectId=$(git hash-object -t commit -w new) +$ git replace FIRST $objectId

This is easier for people just willing to use it without much thinking, and also for those having no idea that git-hash-object creates a new object.

That said, it's a nice example and I've learned quite a few things.
Previous: Jonathan NiederNext: Alexey Shumkin
Message 11 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.