this repo has no description

ft: patch git-branchless to not show stack numbers

hauleth.dev 4c4a2c60 2ee0eb69

verified
+47 -86
flake.lock
···
"beam": {
"inputs": {
"flake-parts": "flake-parts",
-
"nixpkgs": "nixpkgs"
+
"nixpkgs": [
+
"nixpkgs"
+
]
},
"locked": {
"lastModified": 1708268823,
···
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
-
"lastModified": 1706830856,
-
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
+
"lastModified": 1709336216,
+
"narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=",
"owner": "hercules-ci",
"repo": "flake-parts",
-
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
+
"rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2",
"type": "github"
},
"original": {
-
"id": "flake-parts",
-
"type": "indirect"
+
"owner": "hercules-ci",
+
"repo": "flake-parts",
+
"type": "github"
}
},
"flake-parts_3": {
···
}
},
"flake-utils_2": {
+
"inputs": {
+
"systems": "systems_2"
+
},
"locked": {
-
"lastModified": 1667395993,
-
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
+
"lastModified": 1701680307,
+
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
-
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
+
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
···
"type": "github"
}
},
-
"flake-utils_3": {
+
"git-branchless": {
"inputs": {
-
"systems": "systems_2"
+
"nixpkgs": [
+
"nixpkgs"
+
]
},
"locked": {
-
"lastModified": 1701680307,
-
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
-
"owner": "numtide",
-
"repo": "flake-utils",
-
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
+
"lastModified": 1709742645,
+
"narHash": "sha256-3bsRnjkwXN8GdJ6PFTabRv9PxG00DJa80J6kOHCXGmQ=",
+
"owner": "arxanas",
+
"repo": "git-branchless",
+
"rev": "3faa0744cf0b0c7c2fe2bf20e5f441776f21c6dd",
"type": "github"
},
"original": {
-
"owner": "numtide",
-
"repo": "flake-utils",
+
"owner": "arxanas",
+
"repo": "git-branchless",
"type": "github"
}
},
···
]
},
"locked": {
-
"lastModified": 1708806879,
-
"narHash": "sha256-MSbxtF3RThI8ANs/G4o1zIqF5/XlShHvwjl9Ws0QAbI=",
+
"lastModified": 1709764752,
+
"narHash": "sha256-+lM4J4JoJeiN8V+3WSWndPHj1pJ9Jc1UMikGbXLqCTk=",
"owner": "nix-community",
"repo": "home-manager",
-
"rev": "4ee704cb13a5a7645436f400b9acc89a67b9c08a",
+
"rev": "cf111d1a849ddfc38e9155be029519b0e2329615",
"type": "github"
},
"original": {
-
"id": "home-manager",
-
"type": "indirect"
+
"owner": "nix-community",
+
"repo": "home-manager",
+
"type": "github"
}
},
"home-manager_2": {
···
"lexical": {
"inputs": {
"flake-parts": "flake-parts_3",
-
"nixpkgs": "nixpkgs_2",
+
"nixpkgs": "nixpkgs",
"systems": "systems"
},
"locked": {
···
"type": "github"
}
},
-
"nix-elixir": {
-
"inputs": {
-
"flake-utils": "flake-utils_2",
-
"nixpkgs": "nixpkgs_3"
-
},
-
"locked": {
-
"lastModified": 1704300128,
-
"narHash": "sha256-G5qMIxeoKvcXjsBOP32E9UCh0Atjvc/mcatG8MH8QZ4=",
-
"owner": "hauleth",
-
"repo": "nix-elixir",
-
"rev": "fcdeded8314bed0ef21b7d9b25a17b2d290f2bc3",
-
"type": "github"
-
},
-
"original": {
-
"owner": "hauleth",
-
"repo": "nix-elixir",
-
"type": "github"
-
}
-
},
"nixpkgs": {
"locked": {
-
"lastModified": 1708118438,
-
"narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=",
-
"owner": "nixos",
-
"repo": "nixpkgs",
-
"rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80",
-
"type": "github"
+
"lastModified": 1699725108,
+
"narHash": "sha256-NTiPW4jRC+9puakU4Vi8WpFEirhp92kTOSThuZke+FA=",
+
"path": "/nix/store/1ryprai4bllkrna60cmcygxc4qyn79s1-source",
+
"rev": "911ad1e67f458b6bcf0278fa85e33bb9924fed7e",
+
"type": "path"
},
"original": {
-
"owner": "NixOS",
-
"ref": "nixpkgs-unstable",
-
"repo": "nixpkgs",
-
"type": "github"
+
"id": "nixpkgs",
+
"type": "indirect"
}
},
"nixpkgs-lib": {
···
},
"nixpkgs_2": {
"locked": {
-
"lastModified": 1699725108,
-
"narHash": "sha256-NTiPW4jRC+9puakU4Vi8WpFEirhp92kTOSThuZke+FA=",
-
"path": "/nix/store/1ryprai4bllkrna60cmcygxc4qyn79s1-source",
-
"rev": "911ad1e67f458b6bcf0278fa85e33bb9924fed7e",
-
"type": "path"
-
},
-
"original": {
-
"id": "nixpkgs",
-
"type": "indirect"
-
}
-
},
-
"nixpkgs_3": {
-
"locked": {
-
"lastModified": 1704008649,
-
"narHash": "sha256-rGPSWjXTXTurQN9beuHdyJhB8O761w1Zc5BqSSmHvoM=",
+
"lastModified": 1709780214,
+
"narHash": "sha256-p4iDKdveHMhfGAlpxmkCtfQO3WRzmlD11aIcThwPqhk=",
"owner": "NixOS",
"repo": "nixpkgs",
-
"rev": "d44d59d2b5bd694cd9d996fd8c51d03e3e9ba7f7",
+
"rev": "f945939fd679284d736112d3d5410eb867f3b31c",
"type": "github"
},
"original": {
-
"id": "nixpkgs",
-
"type": "indirect"
-
}
-
},
-
"nixpkgs_4": {
-
"locked": {
-
"lastModified": 1708847675,
-
"narHash": "sha256-RUZ7KEs/a4EzRELYDGnRB6i7M1Izii3JD/LyzH0c6Tg=",
"owner": "NixOS",
+
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
-
"rev": "2a34566b67bef34c551f204063faeecc444ae9da",
"type": "github"
-
},
-
"original": {
-
"id": "nixpkgs",
-
"ref": "nixpkgs-unstable",
-
"type": "indirect"
}
},
"nixvim": {
···
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
-
"flake-utils": "flake-utils_3",
+
"flake-utils": "flake-utils_2",
"gitignore": "gitignore",
"nixpkgs": [
"nixvim",
···
"beam": "beam",
"darwin": "darwin",
"flake-parts": "flake-parts_2",
+
"git-branchless": "git-branchless",
"home-manager": "home-manager",
"lexical": "lexical",
-
"nix-elixir": "nix-elixir",
-
"nixpkgs": "nixpkgs_4",
+
"nixpkgs": "nixpkgs_2",
"nixvim": "nixvim"
}
},
+12 -7
flake.nix
···
description = "Hauleth's configuration";
inputs = {
-
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
-
flake-parts.url = "flake:flake-parts";
+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+
flake-parts.url = "github:hercules-ci/flake-parts";
home-manager = {
-
url = "flake:home-manager";
+
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
agnoster = {
url = "github:hauleth/agnoster";
inputs.nixpkgs.follows = "nixpkgs";
};
-
nix-elixir.url = "github:hauleth/nix-elixir";
-
# nix-elixir.url = "flake:nix-elixir";
darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
+
git-branchless = {
+
url = "github:arxanas/git-branchless";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
+
lexical.url = "github:lexical-lsp/lexical";
-
beam.url = "github:shanesveller/nix-beam-flakes";
+
beam = {
+
url = "github:shanesveller/nix-beam-flakes";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
nixvim = {
url = "github:nix-community/nixvim";
···
perSystem = {
self',
pkgs,
-
system,
inputs',
...
}: {
+5 -4
modules/common.nix
···
nix.registry =
{
+
beam.flake = inputs.beam;
+
darwin.flake = inputs.darwin;
+
dotfiles.flake = inputs.self;
+
flake-parts.flake = inputs.flake-parts;
+
lexical.flake = inputs.lexical;
nixpkgs.flake = inputs.nixpkgs;
-
dotfiles.flake = inputs.self;
-
}
-
// pkgs.lib.optionals pkgs.stdenv.isDarwin {
-
darwin.flake = inputs.darwin;
};
nix.package = pkgs.nixFlakes;
+13 -30
modules/git.nix
···
];
settings.aliases.co = "pr checkout";
+
settings.aliases.patch = "!patch2pr";
settings.version = "1";
};
# manual.manpages.enable = true;
home.packages = let
-
git-branchless-man = pkgs.runCommand "git-branchless-man" {} ''
+
git-branchless = inputs.git-branchless.packages.${pkgs.stdenv.hostPlatform.system}.git-branchless.overrideAttrs (_: _: {
+
patches = [
+
./git/no-stack-index.patch
+
];
+
+
postInstall = ''
mkdir -p $out/share/man
-
${pkgs.git-branchless}/bin/git-branchless install-man-pages $out/share/man
-
'';
-
git-cliff = pkgs.rustPlatform.buildRustPackage {
-
pname = "git-cliff";
-
version = "2.0.0-pre";
-
src = pkgs.fetchFromGitHub {
-
owner = "orhun";
-
repo = "git-cliff";
-
rev = "d408e6377a5157f6d285b2733e6640d36316cfd4";
-
hash = "sha256-DqfcSSG/XmeFHckP9Mmv560WA9VJjhDhpYSkYT9YW9I=";
-
};
-
-
cargoHash = "sha256-Qw7ZHLWPgIKqCmjhHwJ4QEz/WQMxrR8eG3tAgAKN7v0=";
-
-
buildNoDefaultFeatures = true;
-
buildFeatures = ["github"];
-
-
# attempts to run the program on .git in src which is not deterministic
-
doCheck = false;
-
-
buildInputs = lib.optionals pkgs.stdenv.isDarwin [
-
pkgs.darwin.apple_sdk.frameworks.CoreFoundation
-
pkgs.darwin.apple_sdk.frameworks.Security
-
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
-
];
-
};
+
$out/bin/git-branchless install-man-pages $out/share/man
+
'';
+
});
in [
pkgs.git-absorb
-
pkgs.git-branchless
-
git-branchless-man
+
git-branchless
pkgs.git-gone
-
git-cliff
+
pkgs.git-cliff
pkgs.git-revise
pkgs.gitAndTools.git-imerge
pkgs.prr
pkgs.hut
+
pkgs.patch2pr
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.imbox
];
+49
modules/git/no-stack-index.patch
···
+
diff --git i/git-branchless-submit/src/github.rs w/git-branchless-submit/src/github.rs
+
index 2e8abbb..9973f5a 100644
+
--- i/git-branchless-submit/src/github.rs
+
+++ w/git-branchless-submit/src/github.rs
+
@@ -523,7 +523,6 @@ fn make_updated_pull_request_info(
+
pull_request_infos: &HashMap<String, client::PullRequestInfo>,
+
commit_oid: NonZeroOid,
+
) -> EyreExitOr<client::UpdatePullRequestArgs> {
+
- let mut stack_index = None;
+
let mut stack_pull_request_infos: IndexMap<NonZeroOid, &client::PullRequestInfo> =
+
Default::default();
+
+
@@ -612,9 +611,6 @@ fn make_updated_pull_request_info(
+
None => continue,
+
};
+
stack_pull_request_infos.insert(stack_commit_oid, pull_request_info);
+
- if stack_commit_oid == commit_oid {
+
- stack_index = Some(stack_pull_request_infos.len());
+
- }
+
}
+
+
let stack_size = stack_pull_request_infos.len();
+
@@ -625,17 +621,6 @@ fn make_updated_pull_request_info(
+
"No pull requests in stack for commit"
+
);
+
}
+
- let stack_index = match stack_index {
+
- Some(stack_index) => stack_index.to_string(),
+
- None => {
+
- warn!(
+
- ?commit_oid,
+
- ?stack_pull_request_infos,
+
- "Could not determine index in stack for commit"
+
- );
+
- "?".to_string()
+
- }
+
- };
+
+
let stack_list = {
+
let mut result = String::new();
+
@@ -650,7 +635,7 @@ fn make_updated_pull_request_info(
+
let commit = self.repo.find_commit_or_fail(commit_oid)?;
+
let commit_summary = commit.get_summary()?;
+
let commit_summary = String::from_utf8_lossy(&commit_summary).into_owned();
+
- let title = format!("[{stack_index}/{stack_size}] {commit_summary}");
+
+ let title = commit_summary;
+
let commit_message = commit.get_message_pretty();
+
let commit_message = String::from_utf8_lossy(&commit_message);
+
let body = format!(
+1
modules/tools.nix
···
jo
glow
pkgs-self.ubin-client
+
reuse
];
}