a bunch of changes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
return {
|
||||
"HotThoughts/jjui.nvim",
|
||||
enabled = false,
|
||||
cmd = {
|
||||
"JJUI",
|
||||
"JJUICurrentFile",
|
||||
|
||||
@@ -218,12 +218,12 @@ return {
|
||||
},
|
||||
-- git
|
||||
{
|
||||
"<leader>gcb",
|
||||
"<leader>jc",
|
||||
function()
|
||||
local cwd = vim.fn.getcwd()
|
||||
|
||||
-- Helper to run git commands and capture both stdout and stderr
|
||||
local function git_cmd(cmd)
|
||||
-- Helper to run commands and capture both stdout and stderr
|
||||
local function run_cmd(cmd)
|
||||
local full_cmd = "cd " .. vim.fn.shellescape(cwd) .. " && " .. cmd .. " 2>&1"
|
||||
local handle = io.popen(full_cmd)
|
||||
local result = handle and handle:read("*a") or ""
|
||||
@@ -234,7 +234,7 @@ return {
|
||||
end
|
||||
|
||||
-- Check if in a git repo
|
||||
local git_dir = git_cmd("git rev-parse --git-dir")
|
||||
local git_dir = run_cmd("git rev-parse --git-dir")
|
||||
if git_dir == "" or git_dir:match("^fatal") then
|
||||
vim.notify("Not in a git repository", vim.log.levels.WARN)
|
||||
return
|
||||
@@ -242,7 +242,7 @@ return {
|
||||
|
||||
-- Get the default branch
|
||||
local function branch_exists(branch)
|
||||
local result = git_cmd("git rev-parse --verify refs/remotes/origin/" .. branch)
|
||||
local result = run_cmd("git rev-parse --verify refs/remotes/origin/" .. branch)
|
||||
-- If branch exists, rev-parse returns a hash; if not, it returns fatal error
|
||||
return not result:match("^fatal")
|
||||
end
|
||||
@@ -259,19 +259,10 @@ return {
|
||||
return
|
||||
end
|
||||
|
||||
-- Get current branch
|
||||
local current_branch = git_cmd("git branch --show-current")
|
||||
if current_branch == "" then
|
||||
current_branch = "HEAD"
|
||||
end
|
||||
|
||||
local compare_target = "origin/" .. default_branch
|
||||
|
||||
-- Get files that differ from origin/main (includes committed + uncommitted changes)
|
||||
local result = git_cmd("git diff --name-only " .. compare_target)
|
||||
|
||||
-- Also get untracked files
|
||||
local untracked = git_cmd("git ls-files --others --exclude-standard")
|
||||
local result = run_cmd("jj diff --from " .. default_branch .. "@origin --to @ --summary | awk '{print $2}'")
|
||||
vim.notify(result)
|
||||
|
||||
-- Combine results
|
||||
local all_files = {}
|
||||
@@ -284,20 +275,13 @@ return {
|
||||
end
|
||||
end
|
||||
|
||||
for line in untracked:gmatch("[^\r\n]+") do
|
||||
if line ~= "" and not seen[line] then
|
||||
seen[line] = true
|
||||
table.insert(all_files, { text = line .. " [untracked]", file = line })
|
||||
end
|
||||
end
|
||||
|
||||
if #all_files == 0 then
|
||||
vim.notify("No modified files (vs " .. compare_target .. ")", vim.log.levels.INFO)
|
||||
vim.notify("No modified files", vim.log.levels.INFO)
|
||||
return
|
||||
end
|
||||
|
||||
Snacks.picker({
|
||||
title = "Modified Files (vs " .. compare_target .. ")",
|
||||
title = "Modified Files",
|
||||
items = all_files,
|
||||
layout = { preset = "default" },
|
||||
confirm = function(picker, item)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"activePack": "solid_snake",
|
||||
"volume": 1.5,
|
||||
"muted": false,
|
||||
"muted": true,
|
||||
"enabledCategories": {
|
||||
"session.start": true,
|
||||
"task.acknowledge": true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"lastChangelogVersion": "0.67.5",
|
||||
"lastChangelogVersion": "0.67.68",
|
||||
"defaultProvider": "anthropic",
|
||||
"defaultModel": "claude-opus-4-7",
|
||||
"defaultThinkingLevel": "off",
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# Tool usage
|
||||
|
||||
FUCKING ALWAYS use timeout on tool usage because sometimes you're stupid, and hang on things because you assume its non interactive. And by that I don't mean appending `timeout` to bash or something, but you have a way to add a timeout to tool calling somehow. I don't know the inner workings of the harness.
|
||||
|
||||
# Validations
|
||||
|
||||
Sometimes some repositories (stupidly) ask you to run validations after changes or some shit. Thing is, you're smart. Your edit tools already contain formatting and LSP hooks. So, you may ask the user if they want you to run said "required" validations, but they're not really required.
|
||||
|
||||
Reference in New Issue
Block a user