ok/jj
1
0
Fork 0
forked from mirrors/jj
Commit graph

557 commits

Author SHA1 Message Date
Benjamin Tan
0c0e001262 git init: add revset alias for trunk() when intializing with existing git repository 2024-07-04 23:04:19 +08:00
Benjamin Tan
d8899e1ae7 git clone: add revset alias for trunk() 2024-07-04 23:04:19 +08:00
Yuya Nishihara
79569f8248 changelog: move "rebase --skip-emptied" entry to unreleased section 2024-07-04 22:38:43 +09:00
Matt Stark
31ac0d7e1f feat(rebase): Rename --skip-empty to --skip-emptied.
This is based on @martinvonz's comment in #3830 about the inconsistency between squash --keep-emptied and rebase --skip-empty.
2024-07-04 12:13:02 +10:00
Matt Kulukundis
3c07d10c5b fix: fix change notes to move something from 0.19 to future 2024-07-03 20:53:40 -04:00
Matt Kulukundis
aaa99e6dc7 diff: add a file-by-file variant for external diff tools 2024-07-03 20:09:17 -04:00
Austin Seipp
74c275ed10 release: version 0.19.0
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-07-03 14:37:40 -07:00
Austin Seipp
30bb90e417 changelog: minor touchups
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-07-03 14:37:40 -07:00
Matt Stark
a840894a02 fix(changelog): Move --keep-emptied to the correct release.
Thanks @scott2000 for catching this.
2024-07-04 01:15:13 +10:00
Matt Stark
ca4eb60426 feat(squash): Add --keep-emptied flag
Fixes #3815
2024-07-03 12:03:26 +10:00
Scott Taylor
e54ecefbd4 commit: add --reset-author option 2024-07-02 18:21:21 -05:00
Yuya Nishihara
5a85254bde docs: add customization example of color-words diff style
The default style is compatible with various terminal emulators, but I suspect
that many people wouldn't like underlines. Let's add an example to override it.
2024-07-02 18:47:36 +09:00
Ilya Grigoriev
1b658ea80e lib id_prefix: look for divergent changes outside short prefix set
Fixes #2476.

Previously, if there was a change id match within the short prefix
lookup set, `jj` would not look for commits with that same change id
outside the short prefix set. So, it wouldn't find the conflicted
commits for a commit with a divergent (AKA conflicted) change id.
2024-06-29 11:44:26 -07:00
Scott Taylor
1eebbe57c0 commit_builder: reset author timestamp on discardable commits
It's common to create empty working-copy commits while using jj, and
currently the author timestamp for a commit is only set when it is first
created. If you create an empty commit, then don't work on a repo for a
few days, and then start working on a new feature without abandoning the
working-copy commit, the author timestamp will remain as the time the
commit was created rather than being updated to the time that work began
or finished.

This commit changes the behavior so that discardable commits (empty
commits with no description) by the current user have their author
timestamps reset when they are rewritten, meaning that the author
timestamp will become finalized whenever a commit is given a description
or becomes non-empty.
2024-06-29 08:35:53 -05:00
Ilya Grigoriev
e6c2108d4d cli: rename jj file print (formerly jj cat) to jj file show
We now have two `cmd_show` in the repo. I think this one should become
`cmd_file_show`, but this should be done uniformly over all the commands
for consistency.

I did *not* keep `print` as an alias (I couldn't find a compelling
reason to do it), but let me know if anyone feels like keeping it.
2024-06-26 17:11:16 -07:00
mlcui
6ae4f45838 cli: Ignore immutable() in jj git push conflict/desc/user checks
Fixes #3029.
2024-06-24 10:45:29 +10:00
James Sully
f8e106a194 cli: git: add jj git remote set-url command 2024-06-23 12:31:43 +10:00
Yuya Nishihara
3c80e3453d cli: branch: make "set" do upsert as before
Since "set <thing>" often adds a <thing> if not exists, it make some sense
that "branch set" does upsert. The current "branch set" use case is now covered
by "branch move", so it's okay to change the "set" behavior.

If new branch is created by "branch set", status message and hint will be
printed to help migration. The user should be able to undo creation if it was
a mistake.

Closes #3584
2024-06-23 09:44:38 +09:00
Yuya Nishihara
ddeb10b3f3 cli: branch: drop support for deprecated --glob option
It's been 8 months since the option got deprecated by 8dbe12da2a.
2024-06-21 09:43:23 +09:00
Philip Metzger
de022aeaa7 next/prev: Implement next/prev --conflict
This allows users to jump to the next conflict in the ancestors or children of 
the start commit.

Continues work on #2126

Co-Authored-By: Noah Mayr <dev@noahmayr.com>
2024-06-20 23:29:41 +02:00
Austin Seipp
397e96f9ae cli: let jj git push --change handle large revsets
In a repo of mine I wanted to do something like the following to push all of my
leaves to the remote as backup:

    jj git push -c 'all:heads(base::) & mine() ~ empty()'

But couldn't, because `jj git push` doesn't handle large revsets, even though
it does handle multiple `-c` arguments, so I had to work out some pipe-to-xargs
command instead.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-06-20 11:40:55 -05:00
Matt Kulukundis
33ab8d4371 cli: Add an option to diff to output only paths. 2024-06-19 20:27:51 -04:00
Yuya Nishihara
b8e921eeae cli: branch: add "move" command that can update branches by revset or name
This basically supersedes the current "branch set" command. The plan is to turn
"branch set" into an "upsert" command, and deprecate "branch create". (#3584)
Maybe we can also add "branch set --new" flag to only allow creation of new
branches. One reason behind this proposed change is that "set" usually allows
both "creation" and "update". However, we also need a typo-safe version of
"set" to not create new branches by accident.

"jj branch move" is useful when advancing ancestor branches. Let's say you've
added a couple of commits on top of an existing PR branch, you can advance the
branch by "jj branch move --from 'heads(::@- & branches())' --to @-". If this
pattern is super common, maybe we can add --advance flag for short.

One drawback of this change is that "git branch --move" is equivalent to
"jj branch rename". I personally don't find this is confusing, but it's true
that "move" sometimes means "rename".
2024-06-18 12:48:32 +09:00
Martin von Zweigbergk
a861baecbf changelog: remove mention of jj file cat/ls aliases
These two aliases didn't survive code review.
2024-06-18 10:24:54 +09:00
tp-woven
1cf53a25f4 Update CHANGELOG.md
Fix config flag name in changelog.
2024-06-18 09:51:49 +09:00
Matt Kulukundis
5d307e628b cli: create jj file list and deprecate jj files 2024-06-17 14:13:36 -04:00
Matt Kulukundis
47bd6f4aa4 feat: Create a file command containing print and chmod
- rearrange the files involved to be more clear about structure
- deprecate existing `jj cat` and `jj chmod`
2024-06-17 12:17:49 -04:00
Matt Kulukundis
8aa71f58f3 feat: add an option to monitor the filesystem asynchronously
- make an internal set of watchman extensions until the client api gets
  updates with triggers
- add a config option to enable using triggers in watchman

Co-authored-by: Waleed Khan <me@waleedkhan.name>
2024-06-16 23:24:22 -04:00
Martin von Zweigbergk
a9953b3fb0 cli: deprecate jj split --siblings in favor of jj split --parallel
This better matches `jj parallelize`.
2024-06-15 22:45:34 +09:00
Manuel Caldeira
72438fc9d2 cli: deprecate -l short alias for --limit in favour of -n
This better matches `git log` and affects `jj log`, `jj op log` and `jj obslog`
2024-06-15 14:14:29 +02:00
Benjamin Tan
9be33724dc conflicts: materialize simplified file conflicts 2024-06-15 06:05:06 +08:00
Yuya Nishihara
a7bff04af8 revset, templater: implement arity-based alias overloading
Still alias function shadows builtin function (of any arity) by name. This
allows to detect argument error as such, but might be a bit inconvenient if
user wants to overload heads() for example. If needed, maybe we can add some
config/revset syntax to import builtin function to alias namespace.

The functions table is keyed by name, not by (name, arity) pair. That's mainly
because std collections require keys to be Borrow, and a pair of borrowed
values is incompatible with owned pair. Another reason is it makes easy to look
up overloads by name.

Alias overloading could also be achieved by adding default parameters, but that
will complicate the implementation a bit more, and can't prevent shadowing of
0-ary immutable_heads().

Closes #2966
2024-06-14 23:11:29 +09:00
Kyle J Strand
03a0921e12 give descendants a range arg 2024-06-13 18:54:57 -06:00
Danny Hooper
986630b270 cli fix: change default from -s @ to -s 'reachable(@, mutable())'
Most of the value of `jj fix` over a shell script is in formatting commits
other than `@`. `@::` often doesn't contain those other commits, so `-s @` is a
bad default.

We could get the same effect from `-s 'mutable() & ::@'`, but `reachable()` is
a bit more explicit and simple to read.

We could also base this on excluding `trunk()`, but that just seems like an
indirection for `mutable()` that might ignore the user's intent if they have
configured part of trunk to be mutable.
2024-06-13 17:08:24 -05:00
Danny Hooper
faf9a9d757 cli fix: add revsets.fix config for default revset to be fixed 2024-06-13 17:08:24 -05:00
Martin von Zweigbergk
bfa0573cab repo/workspace: drop support for old repo formats
It's been more than 6 months since we added support for dynamically
selecting the working copy implementation. This patch drops support
for selecting the default implementation of that and other stores.
2024-06-11 22:03:20 +09:00
Simon Wollwage
3cd1fe4753 Show paths of config files when configurations contain errors
This addresses issue #3317, where as discussed we want to show the paths to
configuration files if they contain errors, to make it easier for the user to
locate them.
2024-06-10 10:14:36 +00:00
Yuya Nishihara
eda7069aee revset: represent program modifier as AST node
The goal is to remove special case from parsing functions and provide slightly
better error message. I don't know if we'd want to use "all:" in aliases, but
there are no strong reasons to disable it.
2024-06-08 12:48:46 +09:00
Martin von Zweigbergk
9fb5307b78 changelog: sort names in 0.18 release notes 2024-06-06 19:46:55 +09:00
Théo Daron
db8f655fe5 changelog: fix @tdaron username 2024-06-06 10:30:08 +02:00
mlcui
f2da2074cc changelog: Fix @mlcui-corp username
I have renamed myself from @mlcui-google to @mlcui-corp, but the
changelog still had the old username.

(That username is now taken by a squatter...)
2024-06-06 14:11:14 +10:00
Austin Seipp
33ac9bca6c release: version 0.18.0 2024-06-05 18:09:20 -05:00
Michael Gattozzi
3bc361a8b9 cli: add --allow-empty-description flag to push
This commit adds an optional flag to be able to push commits with an
empty description to a remote git repo. While the default behavior is
ideal we might need to interact with a repo that has an empty commit
description in it. I ran into this issue a few weeks ago pushing commits
from an open source repo to an empty repo and had to go back to using
git for that push as I would not want to rewrite the history which was
many many years long just for that.

This flag allows users an escape hatch for pushing empty descriptions
for commits and they're sure that they want that behavior.

This commit adds the flag to the `git push` command and updates the docs
for the command. It also updates the original test to make sure that the
flag works as intended to reject the commit when not set and to allow
the commit when the flag is set.

Closes #2633
2024-06-05 14:58:36 -04:00
Benjamin Tan
a3c6a9b1b7 new: allow --insert-before and --insert-after simultaneously 2024-06-05 19:29:27 +08:00
Benjamin Tan
256a51f835 new: convert --insert-before and --insert-after into proper options 2024-06-05 19:29:27 +08:00
Danny Hooper
3050685ff3 cli: implement enough of jj fix to run a single tool on all files 2024-06-04 14:28:21 -05:00
Gregory Anders
f4bedf56f6 cli: clear line after writing
Clear the rest of the cursor line (from the cursor to the end of the
row) after drawing the progress bar rather than clearing the entire line
before drawing. This reduces flickering on terminal emulators which are
able to redraw rapidly.
2024-05-30 12:27:11 -05:00
Martin von Zweigbergk
3090adfd5c repo: consider empty and undescribed merge commits as discardable 2024-05-29 06:54:30 -07:00
Martin von Zweigbergk
e02622b143 repo: when abandoning a working copy that a merge, recreate it
I recently needed to test something on top of a two branches at the
same time, so I created a new commit on top of both of them (i.e. a
merge commit). I then ran tests and made some adjustments to the
code. These adjustments belonged in one of the parent branches, so I
used `jj squash --into` to squash it in there. Unfortunately, that
meant that my working copy became a single-parent commit based on one
of the branches only. We already had #2859 for tracking this issue.

This patch changes the behavior so we create a new working-copy commit
with all of the previous parents.
2024-05-29 06:54:30 -07:00
Ilya Grigoriev
8d3dd17b51 jj git push: safety checks in push negotiation, "force-with-lease"
As explained in the commit, our logic is a bit more complicated than
that of `git push --force-with-lease`. This is to match the behavior of
`jj git fetch` and branch conflict resolution rules.
2024-05-28 21:38:26 -07:00