Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,11 @@
"default": "date",
"markdownDescription": "Specifies the order of commits on the Git Graph View. See [git log](https://git-scm.com/docs/git-log#_commit_ordering) for more information on each order option. This can be overridden per repository via the Git Graph View's Column Header Context Menu."
},
"git-graph.repository.commits.showBodyInline": {
"type": "boolean",
"default": true,
"description": "Show the commit body alongside the subject in the Git Graph table. When disabled, only the commit subject (first line) is shown."
},
"git-graph.repository.commits.showSignatureStatus": {
"type": "boolean",
"default": false,
Expand Down
7 changes: 7 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,13 @@ class Config {
return !!this.config.get('repository.showRemoteHeads', true);
}

/**
* Get the value of the `git-graph.repository.commits.showBodyInline` Extension Setting.
*/
get showCommitBodyInline() {
return !!this.config.get('repository.commits.showBodyInline', true);
}

/**
* Get the value of the `git-graph.repository.showStashes` Extension Setting.
*/
Expand Down
1 change: 1 addition & 0 deletions src/gitGraphView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ export class GitGraphView extends Disposable {
onRepoLoad: config.onRepoLoad,
referenceLabels: config.referenceLabels,
repoDropdownOrder: config.repoDropdownOrder,
showCommitBodyInline: config.showCommitBodyInline,
showRemoteBranches: config.showRemoteBranches,
showStashes: config.showStashes,
showTags: config.showTags
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ export interface GitGraphViewConfig {
readonly onRepoLoad: OnRepoLoadConfig;
readonly referenceLabels: ReferenceLabelsConfig;
readonly repoDropdownOrder: RepoDropdownOrder;
readonly showCommitBodyInline: boolean;
readonly showRemoteBranches: boolean;
readonly showStashes: boolean;
readonly showTags: boolean;
Expand Down
16 changes: 9 additions & 7 deletions web/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// The authenticity of host 'github.pie.apple.com (17.121.132.15)' can't be established.
// ECDSA key fingerprint is SHA256:7ZIubzLSVVGGQ2BgrPF+QnkDYjuJ/xs754ZS8oAZ7QY.
// This key is not known by any other names.
// Are you sure you want to continue connecting (yes/no/[fingerprint])?
// Are you sure you want to continue connecting (yes/no/[fingerprint])?
class GitGraphView {
private gitRepos: GG.GitRepoSet;
private gitBranches: ReadonlyArray<string> = [];
Expand Down Expand Up @@ -912,15 +912,17 @@ class GitGraphView {

for (let i = 0; i < this.commits.length; i++) {
let commit = this.commits[i];
let subject = commit.message;
let subject = commit.message.split('\n')[0];
let body = '';

let splitMessage = commit.message.split('\n\n');
if (this.config.showCommitBodyInline) {
let splitMessage = commit.message.split('\n\n');

if (splitMessage.length > 1) {
subject = splitMessage[0];
splitMessage.shift();
body = splitMessage.join('\n\n');
if (splitMessage.length > 1) {
subject = splitMessage[0];
splitMessage.shift();
body = splitMessage.join('\n\n');
}
}

let message = '<span class="text">' + textFormatter.format(subject) + '</span>';
Expand Down