Skip to content
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

Conflict on rebase clears execute flag on script #3579

Closed
mrstanwell opened this issue Apr 26, 2024 · 3 comments · Fixed by #3580
Closed

Conflict on rebase clears execute flag on script #3579

mrstanwell opened this issue Apr 26, 2024 · 3 comments · Fixed by #3580
Labels
🐛bug Something isn't working

Comments

@mrstanwell
Copy link
Contributor

Description

If a script in a repo has perms 755, but a rebase causes a conflict in the script, the conflicted file's perms get set to 644 and remain so after the conflict is resolved.

Steps to Reproduce the Problem

  1. Run this script to create a repo and introduce a conflict:
    #!/usr/bin/env bash
    
    mkdir /tmp/repro_permfail
    cd /tmp/repro_permfail/
    jj git init
    cat <<EOF > script.sh
    #!/usr/bin/bash
    echo "No conflict here."
    EOF
    chmod 755 script.sh
    jj desc -m "script import"
    jj new -m "set up for conflict"
    cat <<EOF >> script.sh
    echo "Half a conflict."
    EOF
    jj new -r @- -m "create a conflict"
    cat <<EOF >> script.sh
    echo "The other half."
    EOF
  2. Now rebase the "create a conflict" revision onto the "set up for conflict" revision. This will create a conflict: jj rebase -r <REV1> -d <REV2> (I don't know how to script that, unfortunately...)
  3. jj new -r REV1 to resolve the conflict.

Expected Behavior

The permissions on script.sh remain 755.

Actual Behavior

The permissions on script.sh are changed to 644 in the conflicted state and remain so after resolution.

Specifications

  • Platform: macOS 14.4.1 (Sonoma)
  • Version: jj 0.16.0
@martinvonz
Copy link
Owner

2. (I don't know how to script that, unfortunately...)

jj rebase -d '@-+ ~ @' (finds siblings) or jj rebase -d 'description("set up")'

@mrstanwell
Copy link
Contributor Author

Nice. I knew there had to be a clever revset to do that. jj is cool.

@gulbanana
Copy link
Collaborator

I think this is down to conflict materialisation not yet looking through the merge at file bits. I'll have a go at fixing it.

gulbanana added a commit to gulbanana/jj that referenced this issue Apr 26, 2024
gulbanana added a commit to gulbanana/jj that referenced this issue Apr 26, 2024
gulbanana added a commit to gulbanana/jj that referenced this issue Apr 26, 2024
gulbanana added a commit to gulbanana/jj that referenced this issue Apr 26, 2024
gulbanana added a commit to gulbanana/jj that referenced this issue Apr 26, 2024
…rialise the conflicted file as executable

Fixes martinvonz#3579 and adds a testcase for an executable conflict treevalue.
gulbanana added a commit to gulbanana/jj that referenced this issue Apr 26, 2024
…rialise the conflicted file as executable

Fixes martinvonz#3579 and adds a testcase for an executable conflict treevalue.
@PhilipMetzger PhilipMetzger added the 🐛bug Something isn't working label Apr 26, 2024
gulbanana added a commit to gulbanana/jj that referenced this issue May 4, 2024
…rialise the conflicted file as executable

Fixes martinvonz#3579 and adds a testcase for an executable conflict treevalue.
gulbanana added a commit to gulbanana/jj that referenced this issue May 4, 2024
…rialise the conflicted file as executable

Fixes martinvonz#3579 and adds a testcase for an executable conflict treevalue.
gulbanana added a commit to gulbanana/jj that referenced this issue May 4, 2024
…rialise the conflicted file as executable

Fixes martinvonz#3579 and adds a testcase for an executable conflict treevalue.
gulbanana added a commit to gulbanana/jj that referenced this issue May 4, 2024
…rialise the conflicted file as executable

Fixes martinvonz#3579 and adds a testcase for an executable conflict treevalue.
gulbanana added a commit to gulbanana/jj that referenced this issue May 21, 2024
…rialise the conflicted file as executable

Fixes martinvonz#3579 and adds a testcase for an executable conflict treevalue.
gulbanana added a commit that referenced this issue May 21, 2024
…rialise the conflicted file as executable

Fixes #3579 and adds a testcase for an executable conflict treevalue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working
Projects
None yet
4 participants