4,679 questions
0
votes
1
answer
87
views
How to undo a diff chunk in git with cli? [duplicate]
There is a feature in vscode that can help undo changes to a region of code
I'm guessing it has something to do with the chunks that git diff generates.
But I didn't find out how to do this with git ...
0
votes
0
answers
36
views
How to compare two json and get difference as original input json format in groovy/java script
I have to compare two json object and need to get their differences in the same format as input json.
For example I have input json 1 as follow:
{
"entities": [
{
&...
0
votes
3
answers
2k
views
How to compare (diff) two large CSV files where order does not matter
I'm struggling with comparing (diff'ing) 2 large CSV files.
The order of rows doesn't matter
I don't need to print the differences or anything, just a True or False.
For example:
File 1
a,b,c,d
e,f,...
1
vote
1
answer
583
views
Git diff metadata settings and ignoring those
If I delete a file inside git repo, then re-create it with same content, my Ubuntu says
On branch main nothing to commit, working tree clean
But in Windows or Mac, git diff will show every line in the ...
0
votes
2
answers
60
views
How to drop (delete) consecutive values in a Dataframe
I have a dataframe with a column that has 0 Values. I wish to find those 0 values and check if till the end they are 0, drop only those at the end and not in the middle.
this is how the Data in ...
1
vote
1
answer
81
views
"git diff | grep '^\(+++\|---\|-\|+\)'" produces no output
From this answer, when I run this on a git repo with changes, no output is produced
git diff | grep '^\(+++\|---\|-\|+\)'
But when I run just git diff, this output is produced:
diff --git a/...
0
votes
2
answers
79
views
How to diff a very long csv with a very long txt
I have two CSVs:
beta.csv: where multiple NPCs have multiple items (some items are currently invalid)
NPC,Item
NPC 1,Item 1
NPC 1,Item 2
NPC 2,Item 1
NPC 2,Item 3
NPC 3,Item 2
NPC 4,Item 1
NPC 4,Item ...
3
votes
2
answers
1k
views
Is there a way to run a "git difftool" over Remote SSH using VSCode?
As the title says, is there an extension that allows to run difftool over remotessh but within VSCode? I tried a few plugins but they need --no-index or setting git worktree which is not possible to ...
0
votes
0
answers
93
views
Trying to divide the image into two halves and compare them
I have received a homework assignment which involves an image as shown below, and my task is to divide this image into two halves and find the differences between them. I have successfully split the ...
1
vote
1
answer
48
views
PHP: Determine a time diff's largest interval - minutes, hours, days, weeks, etc
After calculating a time difference, how can I determine if the diff is only minutes, or is it hours, or days, weeks, months, years...?
$now = new DateTime('now');
$expire_date = date('Y-m-d H:i:s', ...
5
votes
1
answer
1k
views
Python - Highlight differences between two strings in Jupyter notebook
I have a list of two strings, and I want to highlight and print differences between two strings (specifically in Jupyter notebook). By differences, I specifically mean the insertions, deletions and ...
0
votes
1
answer
112
views
How to extract string difference between two series in pandas?
I am trying to create a new pandas column that contains a diff between two other columns.
what I have:
colA | colB |
this is test | this is a testing |
What I want
colA ...
1
vote
2
answers
66
views
How to find how the values have changed from the begining of their period?
I have a dataframe with timeindex. There is a period (cycle) that starts every august. I want to calculate the difference between the value of each month and the value that was on the previous august (...
2
votes
1
answer
866
views
How to see changes / edits / diffs amidst Git interactive rebase?
I'm trying to execute a rebase of my feature branch onto a development branch that has changed since I started my work. Here's the commit history prior to starting my rebase (ellipsis added by me):
$ ...
2
votes
2
answers
461
views
Why does linux shell diff command sometimes show output related to empty lines even though -B (--ignore-blank-lines) option is present?
Linux diff command accepts an option that instructs it to "ignore changes where lines are all blank", as per the manual page.
And while trying this option, I came across a situation where ...
0
votes
1
answer
83
views
How to diff only one line across different branches?
This command will compare everything:
git diff current_branch other_branch -- file.java
BUT I would like to compare only one line, for only one file across different branches, how can I achieve this?
0
votes
2
answers
52
views
Determine whether changes in a commit are present in another branch or not
What is the best way to determine if the changes made by a commit on a branch are also made in a different commit on other branches or not?
Does git diff allows us to determine this?
0
votes
2
answers
71
views
How can I make a git commit that represents the diff between two other commits?
I'm currently working on a git branch based off of branch main with a HEAD of commit A. I realized I wanted to split the work I was doing into two PRs, but I want to preserve the history properly. An ...
1
vote
2
answers
826
views
Use Python to calculate difference between date in current row and date in previous row and previous column
I am trying to calculate the difference between dates in different rows that are not in the same column. I have the following dataset:
Kiosk
Online
Offline
Online Days
1
12/1/2022
12/5/2022
4
1
12/7/...
0
votes
1
answer
1k
views
How to get difference of columns in DataFrame Pandas?
I need to get a DataFrame with column difference of column that I choose (for example the last one)
I tried using df.diff(axis=1, periods=1) will count column difference with the next column. However, ...
1
vote
2
answers
210
views
Diff of command output between files in two directories with different names
Hope this makes sense. I want to diff the output of a specific command between two files, with slightly different names. I just want a one to one comparison. My directory structure is like this:
...
0
votes
3
answers
335
views
Execute multiple commands in .sh file in Linux
I am trying to create a diff file the following way:
hdiff.pl -nx $FILEDIR/*filename* *filename* > diff_*filename*
However I need to run this command on 150 different files to create 150 different ...
1
vote
2
answers
591
views
See deleted files between two git branches of specific file type
I would like to see the name of all deleted .scss files in a release branch release/1.0 compared to master branch master.
I tried
git checkout release/1.0
git diff --name-only master
But i can see ...
0
votes
0
answers
25
views
Percentage of factor levels the same between factor levels of second variable
Below is a brief reproducible example, with a brief explanation.
age_group is a two-level factor. variant is a factor with a different amount of factors per age_group. prob is the probability of the ...
0
votes
1
answer
46
views
Rollback the content of a git branch from another branch
I have two git branchs (A and B) out of master. I did some dev on branch B then I merged these dev into A then I decided to delete dev of B branch from A.
How can I achieve this knowing that A branch ...