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

Re: [PROBE] cg-commit: show and enable editing of changes with --review

From
Junio C Hamano <junkio@cox.net>
Date
Nov 30, 2005, 00:30 UTC
Message-ID
<7vbr03564t.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20051130000131.GC5365@diku.dk>
Jonas Fonseca <fonseca@diku.dk> writes:
Show 9 quoted lines
> Show changes being commited as a patch appended to the commit message
> buffer. If the original patch is different from the patch extracted from
> the commit message file the original patch will be reverted and the edited
> patch applied before completing the commit.
>
> Due to limitations with cg-patch this can only be used when commiting
> from the project root directory. The error handling if the either the
> original patch or the edited patch does not apply is not optimal, since
> cg-patch will not report errors properly.

I do not do Porcelains, I am not a Cogito user, and I generally do not like encouraging people who are playing an individual developer role to commit something that has never existed in their working tree (hence by definition never been tested), but...

Show 8 quoted lines
> +		echo "Updating changes to edited patch"
> +		# FIXME: Can only be run from the top level
> +		# FIXME: Is very 'fragile' error handling. We should probably
> +		# save the original patch in a local file for recovery?
> +		if ! cg-patch -R < $PATCH; then
> +			backup=$(mktemp commit-backup.XXXXXX)
> +			cp $PATCH $backup
> +			error_msg="unable to revert original patch, backup saved to $backup"

I suspect at least you should be able to use checkout-index for the first one instead of cg-patch.

Previous: Jonas FonsecaNext: Jonas Fonseca
Message 2 of 3 in “[PROBE] cg-commit: show and enable editing of changes with --review”
  1. Jonas FonsecaNov 30, 2005
  2. Junio C HamanoNov 30, 2005
  3. Jonas FonsecaDec 1, 2005

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.