Skip to content
Versora

Manual

Commits

Co-authors and Signed-off-by

9 min read

On this page

Trailers are lines at the end of the commit message in the Key: value format. Git, GitLab and GitHub understand some of them:

  • Co-authored-by: Name <email> says that another person also wrote the commit (pair programming, a review that turned into code). GitLab and GitHub show that person on the commit.
  • Signed-off-by: Name <email> is the certificate of origin for the code (DCO): whoever commits declares that they can contribute that code. Many projects require it.
  • The AI co-authorship trailer is a Co-authored-by that the team uses to mark code written with AI help, when .versora.yml asks for it.

In Versora, the commit description is the source of truth: what's written in it is exactly what goes into the commit. The buttons only add or delete the trailer lines.

Co-authors

Where to find it

  • Commit box › Co-authors button, below the description (tooltip: "Add other people as co-authors of the commit (Co-authored-by trailer)"). With people chosen, the button shows "2 co-authors".
  • The chosen people show up next to the button, with the X to remove them.

Step by step

  1. Click Co-authors. The Commit co-authors list opens, with the "Search for a person, email or username…" field.
  2. While the list loads, "Reading the authors and the project members…" appears.
  3. Type part of the name, email or username. The search ignores accents and case.
  4. Click the person (or move with the arrow keys and press Enter). They get a ✓ and go into the message. Click again to remove them.
  5. For someone who isn't on the list, type Ana Souza <[email protected]> and choose Add Ana Souza. Just the email also works.
  6. Close the list with Esc or by clicking outside. The chosen people show up next to the button; the X on each one ("Remove Ana Souza from the co-authors") removes the person from the message.
  7. Commit. Each person becomes a Co-authored-by: Ana Souza <[email protected]> line.

Where the suggestions come from:

Group in the listWho shows upDetails
Committed to this repositoryAuthors and co-authors of the last 1500 commits on the current branchMost recent first, with the number of commits ("12 commits"). Up to 80 people read and 30 shown. You don't show up (by your user.email)
Project members on GitLab / Project members on GitHubGitLab: the project members, including those inherited from groups; GitHub: those who can be assignees of the repositoryOnly with the server added with a token. Inactive accounts, bots and token service accounts are left out, as is the token owner. Up to 300 members read and 60 shown

Someone who is a member and has also committed shows up only once, with the email from the commits and the username (@ana.souza).

When the server doesn't provide a member's email, the app suggests the private email that the service links to the person, marked with noreply:

  • GitLab: <id>-<username>@users.noreply.<server>;
  • GitHub: <id>+<username>@users.noreply.github.com.

Where the line goes in the description:

  • in the last paragraph, if it's already a trailer block (all lines Key: value);
  • otherwise, in a new paragraph at the end. A BREAKING CHANGE: footer doesn't count as a trailer block for git: the co-authors go into a paragraph after it.

What Versora does in git

To make suggestions, the app reads the history:

bash
git config user.email
git log --max-count=1500 \
  --format="%aN%x1f%aE%x1f%at%x1f%(trailers:key=Co-authored-by,valueonly,separator=%x1d)%x1e"

and, with the server added, the API (/projects/:id/members/all on GitLab, /repos/:owner/:repo/assignees on GitHub). The commit is the usual one, with the lines in the message:

Fix the login form validation

The email is now compared case-insensitively.

Co-authored-by: Ana Souza <[email protected]>
Co-authored-by: Bruno Lima <[email protected]>

How to undo

  • Before the commit: the person's X, or clicking them again in the list, deletes the line. Deleting the line by hand in the description also removes the person.
  • After the commit: Ctrl+Z undoes the commit; or use Amend to fix the list.

Caveats and messages

  • "No one by that name. Type "Name <email>" to add someone else.": the search didn't find anyone.
  • "No one to suggest yet. Type "Name <email>".": a repository with no commits and no server.
  • "To suggest the project members, add the server in Git servers.": the remote has no server with a token (see Servers and accounts).
  • "Project members unavailable: …": the API refused (no permission, server down). The suggestions from the history are still there.
  • The noreply tooltip: "The service's private (noreply) email: GitLab/GitHub links the commit to the person through it. Check whether they use another one."
  • Writing Co-authored-by: … by hand in the description also works: the person shows up next to the button.
  • With Amend, the previous commit's message comes with its co-authors.
  • Templates don't save co-authors, and switching templates keeps the chosen co-authors.
  • Automatic wrapping of the description doesn't touch trailer lines.
  • The project members depend on the server being added in Git servers, with a token.

See also

Signed-off-by

Signed-off-by can go into the message in four ways: written by hand, added to every commit in the repository by a choice of yours, added when a push rule requires it, or added because the team or the company requires it. In the last three cases, Versora writes the line with your identity (user.name and user.email).

Where to find it

  • By hand: in Description (optional), the Signed-off-by: Name <email> line.
  • Always, in this repository: Preferences › Push rules › Signed-off-by › Add to every commit (the Add switch).
  • When a push rule requires it: the "Before committing: push rules" dialog, with Add Signed-off-by and Always add it in this repository.
  • By the team or the company: the rules strip in the commit box, with "Signed-off-by will be added (…)".
  • Palette (Ctrl+P): "Preferences: Push rules".

Step by step: add it to every commit in the repository

  1. Open the repository in a tab.
  2. Go to Preferences › Push rules › Signed-off-by.
  3. Turn on Add: "Adds Signed-off-by: Name <email> (your identity) to every commit message in this repository, like git commit -s."
  4. Commit as usual. The line goes into the message at commit time (it doesn't show up in the box beforehand).

Step by step: when the push rule requires it

  1. Commit. If a push rule requires Signed-off-by ("Require Signed-off-by (DCO)") and the message doesn't have it, the "Before committing: push rules" dialog shows "The message is missing the Signed-off-by line (DCO)", with the line that will be added.
  2. Click Add Signed-off-by ("Signed-off-by added to the message." appears).
  3. To stop seeing the warning in this repository, check Always add it in this repository (it's the same option as in Preferences › Push rules; checking it already adds the line to this commit).
  4. Go ahead with the commit.
SourceWhere it's setDefault value
Your choice, per repositoryPreferences › Push rules › Signed-off-by › Add to every commitOff
Push rulereject_non_dco_commits (GitLab, .versora/push-rules.json or local rules)Depends on the server or the file
Team rule.versora.yml: commit.signoff: trueOff
Company policycommit_signoff: requiredNot set

The "Add to every commit" choice applies only on this computer. For the whole team, use .versora.yml or the push rules.

What Versora does in git

The app takes the identity of whoever is going to commit and adds the line without repeating one that already exists:

bash
git var GIT_COMMITTER_IDENT
git interpret-trailers --if-exists addIfDifferent \
  --trailer "Signed-off-by: Ana Souza <[email protected]>"
git commit -F -

It's the same result as git commit -s.

How to undo

Ctrl+Z undoes the commit. To remove just the line, use Amend and delete it from the description (if no rule requires it, it doesn't come back). To stop adding it, turn off Add in Preferences.

Caveats and messages

  • "Your Git identity (user.name and user.email) isn't set." and "No git identity (user.name and user.email): Signed-off-by can't be written.": without an identity, the line can't be written; the commit is canceled. See Identity.
  • "The "Signed-off-by: Name <email>" line is missing": a commitlint warning, when the repository has the signed-off-by rule.
  • With the team rule on, the strip doesn't flag the missing Signed-off-by: it will be added at commit time.

See also

AI co-authorship trailer

Some teams record in their commits when code was written with AI help. The app has no way of detecting that, so it asks: .versora.yml (or the company policy) sets whether the question is a suggestion or required, and which trailer goes into the message.

Where to find it

  • Commit box › the rules strip, above the commit button.

Step by step

  1. Write the message.
  2. If the mode is suggested, check Has code written with AI help when that's the case.
  3. If the mode is required, answer AI-written code? with Yes or No. Until you answer, the strip shows "answer before committing".
  4. If the team set more than one trailer, choose which one in the AI trailer selector. With only one, the strip shows its text.
  5. Commit. With Yes (or the box checked), the trailer goes into the message.
  6. In required mode, if you commit without answering, the AI-written code? dialog asks first ("This commit has to say whether it has code written with AI help (team rule (.versora.yml)). The answer becomes a co-author trailer in the message."). In Does this commit have AI-written code?, choose No, no AI code or Yes — Co-authored-by: AI Assistant <[email protected]> and click Commit.
KeyValuesEffect
commit.ai_coauthor (.versora.yml) or ai_coauthor (company)off, suggested, requiredOff; "Has code written with AI help" checkbox; required Yes or No question
commit.ai_trailer (.versora.yml) or ai_trailer (company)A string or a list of Key: valueThe trailer (the first one on the list is the default). Without it, Co-authored-by: AI Assistant <[email protected]> applies

When the sources disagree, the strictest mode applies; the company's trailer text wins over the team's.

What Versora does in git

bash
git interpret-trailers --if-exists addIfDifferent \
  --trailer "Co-authored-by: AI Assistant <[email protected]>"
git commit -F -

How to undo

  • Before the commit: uncheck the box or answer No.
  • The answer applies only to the next commit: after a commit, the question comes back for the next one.
  • After the commit: Ctrl+Z or Amend.

Caveats and messages

  • "The AI trailer is already in the message.": you (or a template) already wrote the trailer; the app doesn't add it again.
  • Closing the AI-written code? dialog without answering cancels the commit; the message stays in the box.

See also

Co-authors and Signed-off-by in the commit panel

After the commit, the trailers show up as people, and not as loose text, in the commit details and in blame.

Where to find it

  • Select a commit in the graph: the right panel shows, below the author, the Co-author (or Co-authors) and Signed-off-by groups, each person with initials, name and email.
  • In blame, a commit block with co-authors gets a "+2" mark next to the author (tooltip: "With Ana Souza, Bruno Lima").

Step by step

  1. Click a commit in the graph.
  2. In the right panel, see the message (the body shows up without the trailer lines) and, below the author, the co-authors and who signed the Signed-off-by (tooltip: "Who signed off the commit (Signed-off-by), certifying where the code comes from").

What Versora does in git

It only reads the commit message.

See also