-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FR: manually track moves and copies #3386
Comments
If you look at the Wikipedia VCS page, you'll see that most VCS have a command for |
It's somewhat tangential, but I like the idea of a
|
Sorry I forgot to reply earlier. The plan, IMO, is to let the commit backend decide whether renames are tracked like in Mercurial or detected like in Git. We might have a function like |
I've started work on a hypothetical API [change] to power this feature, draft PR here: #3510. RFC on direction before I go any further I'm hopeful we can do this in a way that:
|
Is your feature request related to a problem? Please describe.
I would like to be able to manually track a file move or copy, and have changes to the history of the source file affect the state of the destination file(s), regardless of any similarity or lack of similarity between the source and destination files.
Describe the solution you'd like
firstly, I'm writing these as subcommands of a
jj file
command, where the currentjj files
could sit as a newjj file ls
. I don't care too much about what it is called in the end, but I think it would be useful to separate the file-oriented commands from the repo-oriented commands, hencejj file
.jj file mv $source $dest
: move file$source
to$dest
, and maintain the history (i.e. don't track it as a file deletion and a file addition, but as a name change)jj file mv --track $source $dest
: retroactively track a file move, without actually moving anything. I.e. for a deleted file$source
and added file$dest
, treat it as if$source
was renamed to$dest
(i.e.mv $source $dest; jj file mv --track $source $dest
would be the same asjj file mv $source $dest
)jj file cp $source $dest
: copy file$source
to$dest
, and copy the change history (if that's possible)jj file cp --track $source $dest
: retroactively track a file copy (i.e.cp $source $dest; jj file cp --track $source $dest
would be the same asjj file cp $source $dest
)Describe alternatives you've considered
An alternative is not to track copies or moves at all. I understand that move tracking is a desired feature, but I do not know if copy tracking is possible (in
jj
), or if so, if it is practical, to implement injj
.Additional context
Similar to #2012, however it is specific to conflict resolution, whereas this is more general.
Related to #47, however this is independent of any file-similarity heuristics.
This is informed by me learning about
hg mv
andhg cp
, only just today, however I am otherwise unfamiliar withhg
, so I may have misunderstood thesehg
commands.The text was updated successfully, but these errors were encountered: