cogito: commit message from stdin and -m switch

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gerrit Pape
Date: Monday, January 2, 2006 - 5:13 am

Hi, cg-commit(1) states

-m MESSAGE
       Specify the commit message, which is used instead of starting up
       an editor (if the input is not  stdin,  the  input  is  appended
       after  all the -m messages). Multiple -m parameters are appended
       to a single commit message, each as separate paragraph.

What happens is that the message on stdin overrides the message given
through the -m switch:

 $ cg-init -m initial
 defaulting to local storage area
 Committing initial tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
 Committed as 4db6889339c6d6775b18673f12bc91adf86f1c2c.
 $ touch foo
 $ cg-add foo
 Adding file foo
 $ echo 'message1' |cg-commit -m 'message0'
 A foo
 Committed as 99d2bbca8ac65fa0c0af7c7536228f4b9470e70f.
 $ cg-log |head
 commit 99d2bbca8ac65fa0c0af7c7536228f4b9470e70f
 tree 4d5fcadc293a348e88f777dc0920f11e7d71441c
 parent 4db6889339c6d6775b18673f12bc91adf86f1c2c
 author Gerrit Pape <pape@smarden.org> Mon, 02 Jan 2006 12:07:59 +0000
 committer Gerrit Pape <pape@smarden.org> Mon, 02 Jan 2006 12:07:59 +0000
 
     message1
 
 commit 4db6889339c6d6775b18673f12bc91adf86f1c2c
 tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
 $ 

This also breaks the selftests with stdin not connected to a terminal
(so in Debian package autobuilder environment):

 $ make
 Generating cg-version...
 $ make test </dev/null 
 make -C t/ all
 make[1]: Entering directory
 `/usr/local/src/Debian/Upstream/GIT/cogito/t'
 *** t9000-init.sh ***
 *   ok 1: initialize w/o the initial commit
 [...]
 * FAIL 16: check if the commit is proper
         [ "$(git-cat-file commit HEAD | sed -n '/^parent/q; /^$/{n; :a p; n; b a}')" = "silly commit message
 
         continued" ]
 *   ok 17: blow away the repository
 [...]
 $ 

Regards, Gerrit.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
cogito: commit message from stdin and -m switch, Gerrit Pape, (Mon Jan 2, 5:13 am)