Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Unable to stage hunks or lines of code in JS files

When I try to stage individual hunks or lines of code from a file, they appear to be staged correctly and the rest of the file remains unstaged. However, after I submit my commit, the entire file is committed.

I've noticed this happening a little prior to March 18th. I suspect it might only be happening in JS files, but I haven't 100% confirmed this to be the case yet.

Has anyone else encountered this issue?

1 answer

0 votes
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 19, 2021

Hey @jordangehman , welcome to the Community!

I haven't seen other mentions of this issue yet but would love to try and reproduce it. What OS and version of Sourcetree are you on? It also sounds odd that it would be restricted to a particular filetype (it's all text to git/sourcetree), but what other languages or filetypes besides javascript do you typically work with?

Thanks,
Daniel

Thanks Daniel! I agree this seems like an odd issue I've encountered.

I'm on MacOS Big Sur 11.2.3 using Sourcetree version 4.1.0.

I also work in a lot of PHP and SCSS files. I will try to reproduce it soon and get back to you.

@Daniel Eads I have confirmed I can only reproduce this in one specific React project, and it only happens when making commits from `.js` files. What information would be helpful for me to share to help identify the issue?

@Daniel Eads I got some more information from a coworker. This particular React project has a pre-commit hook installed via Husky. As part of committing, it runs lint and prettier. From the `package.json` file:

"husky": {
    "hooks": {
        "pre-commit": "lint-staged"
    }
},
"lint-staged": {
    "*.{js,json,jsx,css,md}": [
        "prettier --write",
        "git add"
    ]
},

It seems likely that this is the culprit; there is probably a conflict with this and SourceTree that causes the app to commit the entire file.

Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 26, 2021

Great, thanks for the additional context! I've tapped the Sourcetree development team for their insights here and hope to have something for you shortly.

Like jordangehman likes this
Alan Francis
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 10, 2021

Hi @jordangehman ,
We are currently looking into this issue and we hope we can come up with a fix soon.
We will update here once we figure out that.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events