jj icon indicating copy to clipboard operation
jj copied to clipboard

jj split and jj commit have incorrect author dates

Open outfoxxed opened this issue 6 months ago • 5 comments
trafficstars

Description

When using jj split or jj commit, jj seems to be using an author date significantly in the past. I've been creating new commits using jj split almost exclusively and realized the last 10 days or so of history all have the exact same author date.

The same does not happen with jj new.

Steps to Reproduce the Problem

  1. Use jj split
  2. wait a bit
  3. Use it again, author dates will be identical.

Expected Behavior

Author dates are updated on split.

Actual Behavior

Author dates seem to match the last time they were updated by another command.

outfoxxed avatar May 25 '25 10:05 outfoxxed

That's working as intended. The committer date should be updated.

martinvonz avatar May 28 '25 20:05 martinvonz

Maybe it’s worth reconsidering with the new destination flags, since they have a clear notion of a “new commit”?

emilazy avatar May 29 '25 03:05 emilazy

Possibly. Sometimes people work on multiple things at once without planning ahead and then they split it into multiple commits when they're basically done. It's not clear at all what the author dates should be in that case.

martinvonz avatar May 29 '25 03:05 martinvonz

Maybe @ should be special cased for a split, or commit in particular? I see why it does what it does at this point but its definitely not obvious whats going to happen.

outfoxxed avatar May 29 '25 04:05 outfoxxed

I don't like the idea of special-casing @ for basically anything, but I'll at least reopen this issue to track the issue. Let's see if we hear other thoughts here or if the issue gets lots of upvotes.

martinvonz avatar May 29 '25 14:05 martinvonz

I've just run into this with my workflow. On one of my machines, I use podman for docker, whereas everywhere else I use regular docker. This means I have some slight changes to the docker compose that I need, only on that machine, and that I don't want to commit.

So my workflow is that I have those changes in @ and work on @ and when I'm happy with my work, I split off all the changes except for the compose file customization, keeping the customization in @ but never committing them.

I have similar workflows for other local changes (usually for testing, e.g. turning on debug logging somewhere, adding some print statements, that kind of stuff) that I don't with to commit and the split workflow has been working out great for that. The author times are a bit of an annoyance, it makes it hard for other contributors to see if anything changed e.g. on a PR in gitlab, which only shows the author time.

Panaetius avatar Aug 18 '25 13:08 Panaetius

I feel like a commit should be considered authored when its commit message is first(?) written.

jj commit puts @ at an automatically created empty commit with no description, but I wouldn't consider commits with (no description set) "authored" at all - for me, they're placeholders to mess around without having to think about version control at all.

My use-case for author dates is that I'm using the "commit_timestamp(commit)" = "commit.author().timestamp()" alias introduced in #5132 so that jj log shows when a change was actually made; the commit date is too "low resolution" as jj describe -ring a commit discards commit dates for all descendants simultaneously - so only the author date is a property of the change/commit itself.

It seems like no-description as described in https://github.com/jj-vcs/jj/pull/3906#issuecomment-2180820169 would have partially addressed this?

the author timestamp will become finalized whenever a commit is given a description or becomes non-empty

Could "becomes non-empty" be dropped?

  • jj split treats a half as newly "authored" (and should get an updated timestamp) if its commit message differs from the original
  • jj commit updates the author timestamp iff the commit message gets changed (interactively in editor or via -m)

blepabyte avatar Nov 11 '25 11:11 blepabyte