Git commit issues with multiple files having same name - git-commit

I am working on a project that contains multiples files with same file name. I am using git to maintain local versions of my changes. After staging the modified files, I notice that files with same name are appearing with status "R" implying replacing one file with another of same name but in different directory tree. How to make sure both are committed without being replaced by one another. I could not find relevant help material regarding this in any of git documentation.
Since this is a proprietary code, I am pasting only sample directory structure:
M <Proj_Root_Folder>/<dirA>/<dirAA>/file1.h
M <Proj_Root_Folder>/<dirA>/<dirAA>/file2.h
M <Proj_Root_Folder>/<dirA>/<dirAA>/file3.h
R <Proj_Root_Folder>/<dirB>/<dirBA>/file4.h -> <Proj_Root_Folder>/<dirA>/<dirAA>/file4.h

In git "R" means "rename". Git thinks that ///file4.h is a file that has been moved from where it was originally. Most likely because the file looks simmer.

Related

Error with BiGSCAPE even after installing

I am no coding person by any means but I try my best to work with issues. so I had installed BiGSCAPE to look at the secondary metabolites clusters. I am running it in conda and it seems to be installed fine. As it provides me the version number.
However I keep getting this error. I have test it with the example data as well. and it returns the same results/error
The version I have installed is
BiG-SCAPE 1.1.4 (2022-04-14)
(bigscape) Shaheens-MacBook-Pro:BIG-SCAPE shaheenbibi$ python bigscape.py -i /Downloads/gbks -o ResultsAndres
/Users/shaheenbibi/miniconda3/envs/bigscape/lib/python3.6/site-packages/Bio/SubsMat/init.py:131: BiopythonDeprecationWarning: Bio.SubsMat has been deprecated, and we intend to remove it in a future release of Biopython. As an alternative, please consider using Bio.Align.substitution_matrices as a replacement, and contact the Biopython developers if you still need the Bio.SubsMat module.
BiopythonDeprecationWarning,
Processing input files - -
Output folder already exists
Logs folder already exists
Cache folder already exists
BGC fastas folder already exists
Domtable folder already exists
Domains folder already exists
pfs folder already exists
pfd folder already exists
Including files with one or more of the following strings in their filename: 'cluster', 'region'
Skipping files with one or more of the following strings in their filename: 'final'
Importing GenBank files
Starting with 0 files
Files that had its sequence extracted: 0
Creating output directories
SVG folder already exists
Networks folder already exists
Trying threading on 4 cores
Predicting domains using hmmscan
All fasta files had already been processed
Finished generating domtable files.
Parsing hmmscan domtable files
All domtable files had already been processed
Finished generating pfs and pfd files.
Processing domains sequence files
Adding sequences to corresponding domains file
Reading the ordered list of domains from the pfs files
Creating arrower-like figures for each BGC
Parsing hmm file for domain information
Done
All SVG from the input files seem to be in the SVG folder
Finished creating figures
Calculating distance matrix - -
Performing multiple alignment of domain sequences
No domain fasta files found to align
Trying to read domain alignments (*.algn files)
No aligned sequences found in the domain folder (run without the --skip_ma parameter or point to the correct output folder)
Starting with 0 files Files seems to indicate that something is wrong with your input directory. You may need to put some .gbk files in /Downloads/gbks.
Also note that BiGSCAPE puts a bunch of constraints on the names of the .gbk files: https://git.wageningenur.nl/medema-group/BiG-SCAPE/-/wikis/input. Perhaps your inputs .gbk files need to be renamed.

tfignore wildcard directory segment

Is it possible using .tfignore to add a wildcard to directories? I assumed it would have been a case of just adding an asterisk wildcard to the directory segment. For example:
\path\*\local.properties
However this does not work and I am unsure how I would achieve such behaviour without explicitly declaring every reference that I need excluding. .
Documentation
# begins a comment line
The * and ? wildcards are supported.
A filespec is recursive unless prefixed by the \ character.
! negates a filespec (files that match the pattern are not ignored)
Extract from the documentation.
The documentation should more correctly read:
The * and ? wildcards are supported in the leaf name only.
That is, you can use something like these to select multiple files or multiple subdirectories, respectively, in a common parent:
/path/to/my/file/foo*.txt
/path/to/my/directories/temp*
What may work in your case--to ignore the same file in multiple directories--is just this:
foo*.txt
That is, specify a path-less name or glob pattern to ignore matching files throughout your tree. Unfortunately you have only those two options, local or global; you cannot use a relative path like this--it will not match any files!
my/file/foo*.txt
The global option is a practical one because .tfignore only affects unversioned files. Once you add a file to source control, changes to that file will be properly recognized. Furthermore, if you need to add an instance of an ignored name to source control, you can always go into TFS source control explorer and manually add it.
It seems this is now supported
As you see I edited tfignore in the root folder of the project such that any new branch will ignore its .vs folder when being examined for source control changes
\*\.vs
Directory/folder name wildcarding works for me in VS2019 Professional. For example if I put this in .tfignore:
*uncheckedToTFS
The above will ignore any folder named ending with "uncheckedToTFS", regardless of where the folder is (it doesn't have to be top level folder, can be many levels deep).

jenkins archive artifact excluding all subdirectory

I have a couple of job in Jenkins that archive artifact from the source tree for another job (some unit tests or alike). I have the current situation :
top_dir
\scripts_dir
\some_files
\dir1
\dir2
\dir3
\other_dir
I would like to archive all that is in "top_dir" including the files in "scripts_dir", but not the subdirectories "dir1, dir2,...", which I do not know the name, that are in "scripts_dir". These subdirs are actually Windows directory joints that point to other places on the disk, and I do not want them to be copied.
How do I achieve this with the inculde/excludes pattern of Jenkins ?
I already tried, having include=top_dir/ , exclude=
**/scripts_dir/*/
**/scripts_dir/*/**
**/scripts_dir/**/*
but it always exculdes the whole "scripts_dir" folder.
Finally, by using brute force, I found that the following expression does exclude all the files in the subdirectories of scripts_dir (whatever symlink or not), then removing these subdirs, while keeping the files directly in scripts_dir :
**/scripts_dir/**/*/*/
Thanks for the help anyway.
Reading the ANT manual, there an followsymlinks attribute that defaults to true. You said those things you want to exclude are symlinks (although i am not sure if this will work with Windows joints). Try adding followsymlinks=false
Another solution: if all your files under scripts_dir have a set number of characters in the extension, you can put that into your include statement. This will only pickup files with extensions of 3 characters:
**/scripts_dir/*.???
More on this here

What is the basic setup on SVN to work on a Rails app?

Lets say, I setup my svn host, like: http://www.example.com/svn
Then I create my project at a folder like: /home/me/workspace/my_app
I want to Setup my svn client and ignore files like tmp/* log/* db/schema.rb and such, so what are the commands on console for that? If possible can you write what the full sequence of commands to set this up?
obs: I have found no GUI that suit my needs on Ubuntu kdesvn / rapidsvn :(
Using TortoiseSVN, you could simply use the ignore menu item, but I guess you're not using a GUI.
You can ignore single files by executing this in the containing directory:
svn propset svn:ignore filename .
Replace filename by the filename you want to ignore. This can also be a wildcard expression like *.suo. It can also be a directory like tmp.
you can define the prop svn:ignore
so in your directory where you want ignore file made :
svn propedit svn:ignore .
An editor is open an add your information into. Close it and your file are ignore

Git merge from a specific folder only

I've created a rails website for client X. I now have a client, Y, who wants a website that does the exact same thing as client X, but with a different skin.
I made a git branch from clientXcode and called it clientYcode. I then did all the changes to the views to make it look different, and lala, the same website with a different skin.
Now here's what I don't understand about git: I've made many changes to clientXcode in the views, models, and controllers; and now I want to merge those changes into clientYcode, excluding any view changes. Since views, models, and controllers each have their own folder in rails I was hoping to be able to do something like:
git merge client_x_code 'app/controllers/*', 'app/models/*'
QUESTION 1: Is something like that possible with git? If so, how would I do it?
QUESTION 2: Was branching the best solution to make a copy of my project?
Well I found the easiest solution to my problem...
git checkout clientYcode
git checkout clientXcode "app/controllers/"
git checkout clientXcode "app/models/"
And that does what I want!
The simplest course of action is to merge everything, except the content of the directory you want to keep.
You can do that by adding a merge driver in that directory, as the How do I tell git to always select my local version for conflicted merges on a specific file? question details.
With that merge driver in place, Branching is a good solution in this case.
Extract:
We have a .gitattributes file defined in the dirWithCopyMerge directory (defined only in the branch where the merge will occurs: myBranch), and we have a .git\config file which now contains a merge driver.
[merge "keepMine"]
name = always keep mine during merge
driver = keepMine.sh %O %A %B

Resources