Showing changes to RC files with BitBucket - bitbucket

Why is it that when I try to view a commit that has changes to a RC file it says:
I can use TortoiseGit on my PC with the same commit and view it as a text file, which is what I expected. But not online with BitBucket.

The reason for this is the file encoding: UCS-2 LE BOM (a Microsoft version of UTF-16).
There is currently no fix, as even git diff only supports UTF-8. (Tortoise uses an own diff tool.) The workaround is to change file encoding before commit / after checkout, but I don't think that is suitable on the long run. In the meantime, one can only hope that Atlassian will provide UCS-2 support for Bitbucket Server.

Related

TFS Wrong file encoding coming from git

I've been doing some tests, taking my code from git to TFS, using git-tf. Everything worked pretty much ok, except TFS thinks almost all my files are binary (discovered while finding the answer to this question). Actually, all UTF8 or UTF16 files are detected correctly, but those with an unspecified encoding (.cpp and .h files, mostly) are detected as binary.
Is there a way (some setting, or anything else) to convert from git to TFS and keep the correct encoding? Or, probably less ideal, to change the encoding of all the wrongly encoded ones in TFS?
If you have not set the type of a file, Git will determine it automatically and may treat as binary. With the .gitattributes file you can override its decision.
Tyr to add the diff attribute in the .gitattributes file:
*.cpp -diff
*.h -diff

PlasticSCM fast import: Octal escaped file names when importing from git svn

I'm currently evaluating PlastiSCM. One of our evaluation tasks is to test migration from our SVN repository to Plastic. We want to migrate our trunk only since the branch structure and information is somewhat broken.
I was able to migrate to git with git svn. I fast exported the git repo with -C -M parameters. The import into PlasticSCM succeeded. However, when checking out \master on the imported Plastic Repo, the client complains about missing files. These files don't show up in the "Items" list in the Client.
The filenames which have issues contain octal escape sequences. It turned out that these file names have got german umlaute (ä, ö, ü) in them. I was testing git fast import of the exported stream. Git is able to handle theses filenames correctly.
After some digging I found this aged thread: Fast export/import issues. I've linked to a post telling about the octal coding issue. The thread is actually adressing TFS conversion issues in general.
One author claims to have a script which recodes octal coded characters into an encoding which can be read by PlasticSCM fast import. However, the script is not provided.
Has anyone encountered this problem as well? How could a solution look like? I can't imagine I'm the only one having this problem, especially because Plastic is developed in Spain where non-english characters should encounter quite frequently. I wonder whether this issues is known and tracked by the Plastic SCM development team.

Subversion 'forgets' to commit class files and view files

I am working on an ASP.NET MVC application and using Visual Studio, TortoiseSVN and VisualSVN. When I try to commit my project to the Subversion server, all except the class (.cs) and view (.cshtml) files are committed. Is there a reason why Subversion prefers to forget to commit these files?
Subversion does not automatically add files for committing. Some clients integrated with IDEs may do so as a convenience feature, but the standard SVN behavior is to not do this.
In Windows Explorer, check via TortoiseSVN to see if the items have been added. If not, do so (right-click, TortoiseSVN, Add), then commit.

How to deal with files that are relevant to version control, but that frequently change in irrelevant ways?

.dproj files are essential for Delphi projects, so they have to be under version control.
These files are controlled by the IDE and also contain some information that is frequently changed, but totally irrelevant for version control.
For example: I change the start parameters of the application frequently (several times a day), but don't want to accidently commit the project file if only the part dealing with the start parameters has changed.
So how to deal with this situation?
A clean solution would be to take the file apart, but that isn't possible with the Delphi IDE AFAIK.
Can you ignore a specific part of a file?
We're using Subversion at the moment, but may migrate to Git soon.
In our case, it's rare for a developer to make a meaningful change to the .bdsproj, .dpr, .res files. So we reject the commit (pre-commit hook in subversion) unless special tags: [add project file] or [add res file] are present in the commit comment. This prevents "frivilous" changes to those files.
SVN/git cannot "know" which bits of the file are important, and translating what is important for you to commit or not into file "bits" would be difficult (especially when you don't know exactly how the information is structured within it). The most practical solution is to check the changes that have been made to the file and decide whether to commit them or not to the repository.
You can decide which bits of the file you want to commit with git. This is not, however, the automated process you seem to be looking for.
For the specific case of startparameters: the DDevExtentions plugin of the well known Andreas Hausladen allow for the start parameters be stored separetely of dproj file. See more details about DDevExtensions on his site.
EDIT: If I remember correctly, this feature was created just because he had that exact problem with start parameters and version control.
I would not save the .dproj files directly in version control, but rather provide a default file which should be renamed by the user to get the flawed Delphi working.
Use the --assume-unchanged option on git update-index <file> as described here and stackoverflow/what-is-assume-unchanged.
You could make simple aliases for the those who need it made simple.

TFS commits unchanged files

We're using MS Visual Studio 2008.
TFS seems to take into account the creation date of a file or something, to determine whether the files should be committed.
Is it possible to make TFS test just on the filename and content?
I check out an xml or txt file
I copy the content
I open notepad and paste
I save the file using the same name, and confirm the overwrite
I commit: TFS by default selects the file for committing
Although the name nor the content has changed.
Our concrete use case:
We nightly run a script that generates xml files (overwriting existing files) and commits them.
We would like to commit only the ones that actually changed to keep the history clean.
Thanks in advance!
Jan
When you actually perform the check-in of the file, have a look at the changeset that actually is created in the history view. Normally TFS will check the contents of the files uploaded and will only include a file in the changeset if the MD5 hash of the file is different to the last version that was in version control.
Is this not what you see? Do you have multiple versions of the same file that are identical in content? If so - what extension do the files have? .XML or something else?
Take a look at the tfpt scripts. I think the following is what you are looking for:
TFPT.exe uu /r
The UU is Undo Unchanged and the /r is the recursive flag.
Take a look here: http://blogs.msdn.com/buckh/archive/2005/11/16/493401.aspx
Like Martin said, MD5 should be the only thing that matters.* Copy/pasting text into notepad is not necessarily a no-op. Common differences I've seen:
8-bit codepage -> UTF8, or vice versa
plain UTF8 -> UTF8 with BOM, or vice versa
trailing newline -> no trailing newline, or vice versa
Your XML generation script may exhibit one or more of the same issues. It might also be affected by things specific to XML serialization, e.g., writing the same objects in a different order.
*Exception: if the pending changes on the item include "merge" then it'll always show up in the history -- regardless of contents -- so that merge tracking stays in sync.

Resources