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

Re: [PATCH v1 3/3] Documentation: replace: add --graft option

From
Junio C Hamano <gitster@pobox.com>
Date
May 23, 2014, 18:26 UTC
Message-ID
<xmqqioowjqqk.fsf@gitster.dls.corp.google.com>
In-Reply-To
<537F8021.8080304@gmail.com>
Jakub Narębski <jnareb@gmail.com> writes:
Show 17 quoted lines
> W dniu 2014-05-22 23:33, Christian Couder pisze:
>
>> +--graft <commit> [<parent>...]::
>> +	Create a graft commit. A new commit is created with the same
>> +	content as <commit> except that its parents will be
>> +	[<parent>...] instead of <commit>'s parents. A replacement ref
>> +	is then created to replace <commit> with the newly created
>> +	commit.
>> +
>>   -l <pattern>::
>>   --list <pattern>::
>>   	List replace refs for objects that match the given pattern (or
>
> Here I think you can add the graft replacing example:
>
>   cat .git/info/grafts | while read line
>   do git replace --graft $line; done
Do not cat a single file into a pipeline.
    while read definition
    do
    	git replace --graft $definition
    done <"${GIT_DIR:-.git}/info/grafts"

or something. You might also have to be careful to use "read -r" and/or avoid feeding a comment line (if info/grafts supports it) to the command inside do ... done, but I didn't check what the graft reading code does myself ;-)

Previous: Jakub NarębskiNext: Junio C Hamano
Message 13 of 15 in “Add --graft option to git replace”
  1. 0/3 Add --graft option to git replaceChristian Couder, May 22, 2014
  2. 1/3 replace: add --graft optionChristian Couder, May 22, 2014
  3. Junio C HamanoMay 23, 2014
  4. Jeff KingMay 23, 2014
  5. Junio C HamanoMay 23, 2014
  6. Jeff KingMay 23, 2014
  7. Junio C HamanoMay 23, 2014
  8. Eric SunshineMay 23, 2014
  9. Christian CouderJun 1, 2014
  10. 2/3 replace: add test for --graftChristian Couder, May 22, 2014
  11. 3/3 Documentation: replace: add --graft optionChristian Couder, May 22, 2014
  12. Jakub NarębskiMay 23, 2014
  13. Junio C HamanoMay 23, 2014
  14. Junio C HamanoMay 23, 2014
  15. Christian CouderMay 27, 2014

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.