Skip to content

Conversation

mattmikolay
Copy link
Contributor

@mattmikolay mattmikolay commented Oct 10, 2025

Description

This PR updates the knock branch switch command so that when a .knock_branch file does not yet exist, and after the user chooses to create a new .knock_branch file in the project directory, we automatically create or update .gitignore to ignore .knock_branch.

Tasks

KNO-10035

Loom demo

https://www.loom.com/share/8089e496fa564ad9b818e736466a4a7c

Copy link

linear bot commented Oct 10, 2025

Copy link
Contributor Author

mattmikolay commented Oct 10, 2025

@mattmikolay mattmikolay changed the title Prompt to update .gitignore file feat(KNO-10035): promp to update .gitignore to ignore .knock_branch Oct 10, 2025
@mattmikolay mattmikolay changed the title feat(KNO-10035): promp to update .gitignore to ignore .knock_branch feat(KNO-10035): promp to add .knock_branch to .gitignore Oct 10, 2025
@mattmikolay mattmikolay changed the title feat(KNO-10035): promp to add .knock_branch to .gitignore feat(KNO-10035): prompt to add .knock_branch to .gitignore Oct 10, 2025
);
});

describe("and ancestor directory contains a .gitignore file", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I failed to find a way to use Sinon to mock the isFileIgnoredByGit function so that it returns true. That’s why there’s no test case here for when the .gitignore file already exists and already ignores .knock_branch.

@mattmikolay mattmikolay marked this pull request as ready for review October 10, 2025 18:21
@mattmikolay mattmikolay force-pushed the mattmik-kno-10035-cli-automatically-update-gitignore-to-ignore-knock_branch branch from 314724d to 23f1e80 Compare October 13, 2025 13:16
@mattmikolay mattmikolay force-pushed the mattmik-kno-10034-cli-create-knock_branch-file-when-it-does-not-exist branch from de49ee1 to 2363bcd Compare October 13, 2025 13:16
@mattmikolay mattmikolay changed the title feat(KNO-10035): prompt to add .knock_branch to .gitignore feat(KNO-10035): prompt to add .knockbranch to .gitignore Oct 13, 2025
@mattmikolay mattmikolay force-pushed the mattmik-kno-10034-cli-create-knock_branch-file-when-it-does-not-exist branch from 2363bcd to 4249415 Compare October 13, 2025 13:41
@mattmikolay mattmikolay force-pushed the mattmik-kno-10035-cli-automatically-update-gitignore-to-ignore-knock_branch branch from 23f1e80 to 185e03b Compare October 13, 2025 13:41
@mattmikolay mattmikolay force-pushed the mattmik-kno-10034-cli-create-knock_branch-file-when-it-does-not-exist branch from 4249415 to 54053d6 Compare October 13, 2025 13:44
@mattmikolay mattmikolay force-pushed the mattmik-kno-10035-cli-automatically-update-gitignore-to-ignore-knock_branch branch from 185e03b to 2b364eb Compare October 13, 2025 13:44
@mattmikolay mattmikolay force-pushed the mattmik-kno-10034-cli-create-knock_branch-file-when-it-does-not-exist branch 3 times, most recently from 506c585 to 811cb3b Compare October 13, 2025 15:35
@mattmikolay mattmikolay force-pushed the mattmik-kno-10035-cli-automatically-update-gitignore-to-ignore-knock_branch branch from 2b364eb to 7a22fa1 Compare October 13, 2025 15:35
@mattmikolay mattmikolay changed the base branch from mattmik-kno-10034-cli-create-knock_branch-file-when-it-does-not-exist to graphite-base/625 October 13, 2025 15:48
@mattmikolay mattmikolay force-pushed the mattmik-kno-10035-cli-automatically-update-gitignore-to-ignore-knock_branch branch from 7a22fa1 to 5bf6934 Compare October 13, 2025 15:49
@graphite-app graphite-app bot changed the base branch from graphite-base/625 to main October 13, 2025 15:49
@mattmikolay mattmikolay force-pushed the mattmik-kno-10035-cli-automatically-update-gitignore-to-ignore-knock_branch branch from 5bf6934 to 49abde5 Compare October 13, 2025 15:49
Copy link
Contributor Author

mattmikolay commented Oct 13, 2025

Merge activity

  • Oct 13, 5:22 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 13, 5:22 PM UTC: @mattmikolay merged this pull request with Graphite.

@mattmikolay mattmikolay merged commit ffaa6e2 into main Oct 13, 2025
8 checks passed
@mattmikolay mattmikolay deleted the mattmik-kno-10035-cli-automatically-update-gitignore-to-ignore-knock_branch branch October 13, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants