diff --git a/src/segments/sapling.go b/src/segments/sapling.go index 90013da3..5af93a80 100644 --- a/src/segments/sapling.go +++ b/src/segments/sapling.go @@ -40,17 +40,18 @@ func (s *SaplingStatus) add(code string) { const ( SAPLINGCOMMAND = "sl" - SLCOMMITTEMPLATE = "no:{node}\nns:{sl_node}\nnd:{sl_date}\nun:{sl_user}\nbm:{activebookmark}" + SLCOMMITTEMPLATE = "no:{node}\nns:{sl_node}\nnd:{sl_date}\nun:{sl_user}\nbm:{activebookmark}\ndn:{desc|firstline}" ) type Sapling struct { scm - ShortHash string - Hash string - When string - Author string - Bookmark string + ShortHash string + Hash string + When string + Author string + Bookmark string + Description string Working *SaplingStatus } @@ -147,6 +148,8 @@ func (sl *Sapling) setCommitContext() { sl.Author = line case "bm:": sl.Bookmark = line + case "dn:": + sl.Description = line } } } diff --git a/website/docs/segments/sapling.mdx b/website/docs/segments/sapling.mdx index d8ddfcc1..ac749c18 100644 --- a/website/docs/segments/sapling.mdx +++ b/website/docs/segments/sapling.mdx @@ -45,16 +45,17 @@ Display [sapling][sapling] information when in a sapling repository. ### Properties -| Name | Type | Description | -| ------------ | --------------- | ------------------------------------- | -| `.RepoName` | `string` | the repo folder name | -| `.Working` | `SaplingStatus` | changes in the worktree (see below) | -| `.Author` | `string` | the author of the commit | -| `.Hash` | `string` | the full hash of the commit | -| `.ShortHash` | `string` | the short hash of the commit | -| `.When` | `string` | the commit's relative time indication | -| `.Bookmark` | `string` | the commit's bookmark (if any) | -| `.Dir` | `string` | the repository's root directory | +| Name | Type | Description | +| -------------- | --------------- | ------------------------------------------ | +| `.RepoName` | `string` | the repo folder name | +| `.Working` | `SaplingStatus` | changes in the worktree (see below) | +| `.Description` | `string` | the first line of the commit's description | +| `.Author` | `string` | the author of the commit | +| `.Hash` | `string` | the full hash of the commit | +| `.ShortHash` | `string` | the short hash of the commit | +| `.When` | `string` | the commit's relative time indication | +| `.Bookmark` | `string` | the commit's bookmark (if any) | +| `.Dir` | `string` | the repository's root directory | ### SaplingStatus