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

Re: [PATCH] cg-commit: prefix the relative path to the message file

From
Jim Meyering <jim@meyering.net>
Date
Sep 16, 2006, 15:07 UTC
Message-ID
<87fyerq291.fsf@rho.meyering.net>
In-Reply-To
<20060825000614.GF2817@diku.dk>
Jonas Fonseca <fonseca@diku.dk> wrote:
Show 37 quoted lines
> Makes the -M switch work from a subdirectory.
>
> Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
>
> ---
>
> Jim Meyering <jim@meyering.net> wrote Wed, Aug 23, 2006:
>> Hello,
>
> Hi,
>
>> I discovered that "cg-commit -M MSG-FILE ..." fails when run from
>> a subdirectory, and when MSG-FILE is a relative file name.
>> This is using cogito-0.17.3-2 from Debian/unstable, but the problem
>> remains when using the latest cogito sources, pulled minutes ago.
>
> The attached patch should fix this problem.
>
> ---
>
>  cg-commit |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/cg-commit b/cg-commit
> index 0cec58f..5cebd81 100755
> --- a/cg-commit
> +++ b/cg-commit
> @@ -398,7 +398,7 @@ fi
>
>  if [ "$msgfile" ]; then
>  	[ "$written" ] && echo >>"$LOGMSG"
> -	cat "$msgfile" >>"$LOGMSG" || exit 1
> +	cat "$_git_relpath$msgfile" >>"$LOGMSG" || exit 1
>  	written=1
>  fi
>
>

Thank you! That solved the problem for me.

Previous: Jonas Fonseca
Message 3 of 3 in “"cg-commit -M msg-file ..." fails when not run from top of tree”
  1. Jim MeyeringAug 23, 2006
  2. cg-commit: prefix the relative path to the message fileJonas Fonseca, Aug 25, 2006
  3. Jim MeyeringSep 16, 2006

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.