git-coco 0.12.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6329,7 +6329,10 @@ const handler$2 = async (argv, logger) => {
6329
6329
  parser,
6330
6330
  });
6331
6331
  const appendedText = argv.append ? `\n\n${argv.append}` : '';
6332
- return `${commitMsg.title}\n\n${commitMsg.body}${appendedText}`;
6332
+ const branchName = await getCurrentBranchName({ git });
6333
+ const ticketId = extractTicketIdFromBranchName(branchName);
6334
+ const ticketFooter = argv.appendTicket && ticketId ? `\n\nPart of **${ticketId}**` : '';
6335
+ return `${commitMsg.title}\n\n${commitMsg.body}${appendedText}${ticketFooter}`;
6333
6336
  },
6334
6337
  noResult: async () => {
6335
6338
  await noResult$1({ git, logger });
@@ -6368,6 +6371,10 @@ const options$2 = {
6368
6371
  description: 'Add content to the end of the generated commit message',
6369
6372
  type: 'string',
6370
6373
  },
6374
+ appendTicket: {
6375
+ description: 'Append ticket ID from branch name to the commit message',
6376
+ type: 'boolean',
6377
+ },
6371
6378
  additional: {
6372
6379
  description: 'Add extra contextual information to the prompt',
6373
6380
  type: 'string',
package/dist/index.js CHANGED
@@ -6350,7 +6350,10 @@ const handler$2 = async (argv, logger) => {
6350
6350
  parser,
6351
6351
  });
6352
6352
  const appendedText = argv.append ? `\n\n${argv.append}` : '';
6353
- return `${commitMsg.title}\n\n${commitMsg.body}${appendedText}`;
6353
+ const branchName = await getCurrentBranchName({ git });
6354
+ const ticketId = extractTicketIdFromBranchName(branchName);
6355
+ const ticketFooter = argv.appendTicket && ticketId ? `\n\nPart of **${ticketId}**` : '';
6356
+ return `${commitMsg.title}\n\n${commitMsg.body}${appendedText}${ticketFooter}`;
6354
6357
  },
6355
6358
  noResult: async () => {
6356
6359
  await noResult$1({ git, logger });
@@ -6389,6 +6392,10 @@ const options$2 = {
6389
6392
  description: 'Add content to the end of the generated commit message',
6390
6393
  type: 'string',
6391
6394
  },
6395
+ appendTicket: {
6396
+ description: 'Append ticket ID from branch name to the commit message',
6397
+ type: 'boolean',
6398
+ },
6392
6399
  additional: {
6393
6400
  description: 'Add extra contextual information to the prompt',
6394
6401
  type: 'string',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-coco",
3
- "version": "0.12.1",
3
+ "version": "0.13.0",
4
4
  "description": "zero-effort git commits with coco.",
5
5
  "author": "gfargo <ghfargo@gmail.com>",
6
6
  "license": "MIT",