git commit --amend -F option help

169 views
Skip to first unread message

praveenm

unread,
Dec 10, 2017, 8:58:51 AM12/10/17
to Repo and Gerrit Discussion
Dear All,

We are using git commit -F option to commit in git.

when we use git commit --amend option with -F it is creating new gerrit permalink.
ex: git commit --amend -F /opt/commitmessage.txt

How to amend the commit msg without creating new permalink.

Let me know if  other options are available.

Thanks in Advance

Matthias Sohn

unread,
Dec 10, 2017, 11:17:22 AM12/10/17
to praveenm, Repo and Gerrit Discussion
Why are you using the commit -F option ?

-Matthias 

praveenm mulimani

unread,
Dec 11, 2017, 12:38:43 AM12/11/17
to Matthias Sohn, Repo and Gerrit Discussion
Dear Matthia,

Thanks for the rteply

We are using -F option to provide commit message using text file

git commit --amend -F /opt/commitmessage.txt

--
Praveen M
9986069592

David Pursehouse

unread,
Dec 11, 2017, 3:28:02 AM12/11/17
to praveenm mulimani, Matthias Sohn, Repo and Gerrit Discussion
On Mon, Dec 11, 2017 at 2:38 PM praveenm mulimani <praveen....@gmail.com> wrote:
Dear Matthia,

Thanks for the rteply

We are using -F option to provide commit message using text file

git commit --amend -F /opt/commitmessage.txt


Gerrit uses the Change-Id footer to associate commits to changes.

If you use the -F option, the entire content of the commit message is replaced with the content of the file, and any previously existing Change-Id footer is removed (and I guess a new one generated).  Then when you push it to gerrit, gerrit treats it as a new change.

To fix this, either stop using -F, or when amending the commit manually add the previous Change-Id line back.

 

On Sun, Dec 10, 2017 at 9:47 PM, Matthias Sohn <matthi...@gmail.com> wrote:
On Sun, Dec 10, 2017 at 2:58 PM, praveenm <praveen....@gmail.com> wrote:
Dear All,

We are using git commit -F option to commit in git.

when we use git commit --amend option with -F it is creating new gerrit permalink.
ex: git commit --amend -F /opt/commitmessage.txt

How to amend the commit msg without creating new permalink.

Let me know if  other options are available.

Why are you using the commit -F option ?

-Matthias 



--
Praveen M
9986069592

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages