jj icon indicating copy to clipboard operation
jj copied to clipboard

FR: allow pushing commits with an empty author

Open colemickens opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

context: https://discord.com/channels/968932220549103686/968932220549103689/1206485113949388860

context explained:

  1. I am using jj with nixpkgs.
  2. I rebased my custom cmpkgs branch on nixos-unstable@nixos (aka https://github.com/nixos/nixpkgs -> nixos-unstable branch)
  3. I tried to push
  4. I get:
Error: Won't push commit c2e3bdf541bc since it has no author and/or committer set

This stems from this commit: https://github.com/NixOS/nixpkgs/commit/c2e3bdf541bc8a2a5a348c1b030815aeef8b2723 from this PR: https://github.com/NixOS/nixpkgs/pull/284580

Describe the solution you'd like

A flag to ignore this safety/sanity check and allow me to push anyway.

Describe alternatives you've considered n/a seems unavoidable, I can't control upstream.

Additional context

workaround

> # this assumes you have named jj branch and 'origin' git branch the same
> b=cmpkgs # branch name
> # make sure you don't have [ui] color=always
> git -C .jj/repo/store/git push origin $(jj log -r ${b} -T commit_id --no-graph):$b -f

colemickens avatar Feb 12 '24 06:02 colemickens

See also: #2633, which is similar but for the case of a fully empty commit message, as opposed to the author.

thoughtpolice avatar Feb 13 '24 15:02 thoughtpolice

@thoughtpolice suggested in https://discord.com/channels/968932220549103686/1166440777325490276/threads/1251567859465719960 that we should not run this check on immutable commits.

This is slightly different to having an option. Both seem useful to me, but if people agree that the immutable commits approach is a good one, that feature seems more important to me.

ilyagr avatar Jun 15 '24 23:06 ilyagr