@snapcommit/cli 3.9.18 → 3.9.20

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.
@@ -646,10 +646,21 @@ async function executeGitCommands(commands) {
646
646
  else if (cmd.includes('git stash')) {
647
647
  // Stashing
648
648
  if (cmd.includes('pop') || cmd.includes('apply')) {
649
- console.log(chalk_1.default.green('\n✓ Stash applied\n'));
649
+ // Only show message if there was actually something to pop
650
+ if (output.trim() && !output.includes('No stash entries')) {
651
+ console.log(chalk_1.default.green('\n✓ Stash applied\n'));
652
+ }
650
653
  }
651
- else {
652
- console.log(chalk_1.default.green('\n✓ Changes stashed\n'));
654
+ else if (!cmd.includes('list')) {
655
+ // Check if there was actually something to stash
656
+ if (output.includes('Saved working directory') || output.includes('No local changes')) {
657
+ if (output.includes('No local changes')) {
658
+ // Nothing to stash - that's fine, don't show message
659
+ }
660
+ else {
661
+ console.log(chalk_1.default.green('\n✓ Changes stashed\n'));
662
+ }
663
+ }
653
664
  }
654
665
  }
655
666
  else if (cmd.includes('git reset')) {
@@ -746,6 +757,11 @@ async function executeGitCommands(commands) {
746
757
  console.log(chalk_1.default.gray('💡 Tip: Most conflicts are simple! Just pick the better code.\n'));
747
758
  return;
748
759
  }
760
+ // Skip harmless errors
761
+ if (errorMsg.includes('no stash entries found') || errorMsg.includes('no local changes to save')) {
762
+ // Nothing to stash/pop - that's fine, continue silently
763
+ continue;
764
+ }
749
765
  // Try to auto-fix common errors
750
766
  const fixed = await tryAutoFix(error, cmd);
751
767
  if (!fixed) {
@@ -801,10 +817,11 @@ async function executeGitHubCommand(intent) {
801
817
  catch (branchError) {
802
818
  // If we can't determine branch, show generic error
803
819
  }
804
- // Check if there are no commits to push
820
+ // Check if there are no commits compared to main/master
805
821
  try {
806
- const commitsAhead = (0, child_process_1.execSync)('git rev-list --count @{u}..HEAD 2>/dev/null || echo 0', { encoding: 'utf-8' }).trim();
807
- if (commitsAhead === '0') {
822
+ const defaultBranch = (0, child_process_1.execSync)('git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null || echo refs/remotes/origin/main', { encoding: 'utf-8' }).trim().replace('refs/remotes/origin/', '');
823
+ const commitsAhead = (0, child_process_1.execSync)(`git rev-list --count origin/${defaultBranch}..HEAD 2>/dev/null || echo 0`, { encoding: 'utf-8' }).trim();
824
+ if (commitsAhead === '0' || commitsAhead === '') {
808
825
  console.log(chalk_1.default.yellow('⚠️ No new commits on this branch!\n'));
809
826
  console.log(chalk_1.default.white('Why this fails:'));
810
827
  console.log(chalk_1.default.gray(' • PRs need at least 1 commit that\'s not in main'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapcommit/cli",
3
- "version": "3.9.18",
3
+ "version": "3.9.20",
4
4
  "description": "Instant AI commits. Beautiful progress tracking. Never write commit messages again.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {