How to find changeset by change in a file in TFS 2010 - tfs

I have a huge css file and want to find a changeset that applied a particular change.
For example in this file
p {
font-family: Garamond, serif;
}
h2 {
font-size: 110 %;
color: red;
background: white;
}
I want to know, when font-size was set to 110 %. But this file is huge and lots of changes commited before and after the required changeset, so I cannot search only for file, I've got too many results.
I also understand that there is quite a problem because this line could move up/down because of some intermediate insertions/deletions.
Could you help me?

You are probably looking for Annotate feature in TFS
Look here: http://msdn.microsoft.com/en-us/library/bb385979.aspx
You can annotate a file to learn who made changes and what changes they made in all earlier versions of the file

You could use the View History feature also, apart from the Annotate feature. However, both will be useless if the person who committed the change, did not put appropriate comment.
If using the View History feature and there are no appropriate comments, you have to go through the list of changesets, right click a changeset->ChangeSet Details->Select your file and Compare with previous version.

Related

how to Remove "open with Gitkraken" from context menu?

I have a wasteful option left after uninstalling Gitkraken in windows 7 ultimate 64bit. I have tried many options like,
in regidit i have searched in following places:
[HKEY_CLASSES_ROOT\*\shell]
[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers]
[-HKEY_CLASSES_ROOT\Directory\background\shell\git_gui]
[-HKEY_CLASSES_ROOT\Directory\background\shell\git_shell]
[-HKEY_CLASSES_ROOT\Directory\Shell\git_gui]
[-HKEY_CLASSES_ROOT\Directory\Shell\git_shell]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\git_gui]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\git_shell]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_gui]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_shell]
HKEY_CLASSES_ROOT\*\OpenWithList
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers
HKEY_CLASSES_ROOT\Directory\Background
HKEY_CLASSES_ROOT\Directory\shell
HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers
HKEY_CLASSES_ROOT\Drive\shell
HKEY_CLASSES_ROOT\Drive\shellex\ContextMenuHandlers
HKEY_CLASSES_ROOT\Folder\shell
HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers
but i have got nothing related to git or git kraken so that i can remove that option.
It's worth noting that there are two items added to the context menu, one for each of the two right-click contexts. And as such, two entries exist in the Registry.
Context 1 - In the parent folder, when right-clicking on the folder icon of the repository:
HKEY_CLASSES_ROOT\Directory\shell\GitKraken
Context 2 - Within the repository folder, right-clicking on background white-space:
HKEY_CLASSES_ROOT\Directory\Background\shell\GitKraken
I tend to use the second one more often, and there was a bug when I first installed the program. In order to fix this bug, change the last argument from %L to %V.
From:
"C:\Users\Paul\AppData\Local\gitkraken\update.exe" --processStart=gitkraken.exe --process-start-args="-p %L"
To:
"C:\Users\Paul\AppData\Local\gitkraken\update.exe" --processStart=gitkraken.exe --process-start-args="-p %V"
The entry is here on my machine:
HKEY_CLASSES_ROOT\Directory\Background\shell\GitKraken
I'm not clear from the format of your list where you were actually checking, but that might be worth a look.
[-HKEY_USERS\...
S-1-5-21-307178686-3694073347-4169164670-1001\...
Software\Classes\Directory\shell\GitKraken]
S-1-5-21-307178686-3694073347-4169164670-1001 should be related to your user
Here is my screenshot choose the one without the classes should be right.

How to hide line numbers on Gerrit

I want to copy a small chunk of code from Gerrit, but the line numbers are getting copied too. Is there any way to get rid of these line numbers?
UPDATE for IE: install a page-css-editing plugin like the "Internet Explorer Developer Toolbar" (or whatever) and add the property display: none to the CSS element .CodeMirror-linenumber . (see: https://superuser.com/questions/286184/how-do-you-edit-css-in-ie-developer-tools for details how to do that)
You can go to the diff view and copy the code from there - it should allow selecting without the lines. (You can also download the file from there).
If not, where exactly in Gerrit are you copying from (and on what browser)?
Open up inspect element on your browser and set this CSS propery for the ol element:
list-style-type: none;

Is it possible to combine two .po translation files together?

We have two .po files, each from different branches of a piece of software.
We need to combine these into a single .po file.
There are duplicates between the two files, and the ideal handling would be for one file's strings to be favoured (consistently).
We have a SUSE system so the --output-file doesn't seem to have the behaviour of ignoring/merging duplicates which the Sun version has according to a man page I found from a web search. (We do not have a Sun machine handy!)
What you are looking for is the msgcat util, it concatenates and merges the specified PO dictionaries.
This is part of gettext utils, for more information please consult gettext manual page on msgcat.
you can use poedit.
To merge your current po-file, you must to open it and click:
Catalog > Update from POT-file.
Set the filter to all files and select your second.po file
Poedit will show you new & obsolete strings
I use msgmerge:
msgmerge [old_file.po] [new_file.po] > output.po
It works for me, but be aware that it does a silly merge, it is, it discards the entries in the old_file (new file items overwrites old one items).

Get labels applied to a particular version of an item in TFS source control

I'm trying to get a list of labels that apply to a particular version of a particular file in TFS Source Control. So far, I've gotten a set of labels that apply to any version of a particular file. Does anyone have any experience getting labels for a particular item?
For example, I have $/Project/Folder/Item.cs, which was modified in changesets 301, 401, and 601. Labels Build1 - Build 99 exist for the project. Build1 - Build10 were applied before changeset 301 (i.e. before Item.cs was created). Build96 - Build99 were applied to the v601 of Item.cs. If I run
vcServer.QueryLabels(null, "$/Project", null, false, "$/Project/Folder/Item.cs", new ChangesetVersionSpec(6))
I get Build11 - Build99 as results. I haven't figured out how to get a query to return fewer than this many labels. Ideally, the query I run will return 4 labels (Build96 - Build 99).
The context of this question is a TFS Project, with CCNET for a build server. I'm trying to relate work items to builds, starting with a work item number.
Any tips? Or examples of QueryLabels? Or better docs for QueryLabels than the MSDN docs?
This is possible, see here: http://social.msdn.microsoft.com/Forums/en-US/tfsversioncontrol/thread/9f41f37e-4fda-4b56-91a3-f2b7e0c0e22d
Basically, once you get back the list of labels, you have to look through each label and see what changeset of the item you're interested in it applies to. Be sure to pass in the "includeItems = false" flag to QueryLabels, otherwise you'll have to look through every item on the label.
What you are wanting to do should definitely be possible using the API. The answer I gave to the other question was about seeing the labels inline with history in the UI.
For more information about doing what I think you are wanting to do, then take a look at:
Buck Hodges: Finding the changes between two labels in TFS version control
and also
Manish Agarwal: What is GenCheckinNotesUpdateWorkitem task?
Hope that helps.
Martin.
It looks like it's not possible with the current TFS version, but may be with the next.

Adding MS-Word-like comments in LaTeX

I need a way to add text comments in "Word style" to a Latex document. I don't mean to comment the source code of the document. What I want is a way to add corrections, suggestions, etc. to the document, so that they don't interrupt the text flow, but that would still make it easy for everyone to know, which part of the sentence they are related to. They should also "disappear" when compiling the document for printing.
At first, I thought about writing a new command, that would just forward the input to \marginpar{}, and when compiling for printing would just make the definition empty. The problem is you have no guarantee where the comments will appear and you will not be able to distinguish them from the other marginpars.
Any idea?
todonotes is another package that makes nice looking callouts. You can see a number of examples in the documentation.
Since LaTeX is a text format, if you want to show someone the differences in a way that they can use them (and cherry pick from them) use the standard diff tool (e.g., diff -u orig.tex new.tex > docdiffs). This is the best way to annotate something like LaTeX documents, and can be easily used by anyone involved in the production of a document from LaTeX sources. You can then use standard LaTeX comments in your patch to explain the changes, and they can be very easily integrated. If the document lives in a version control system of some sort, just use the VCS to generate a patch file that can be reviewed.
I have used changes.sty, which gives basic change colouring:
\added{new text}
\deleted{old text}
\replaced{new text}{old text}
All of these take an optional parameter with the initials of the author who did this change. This results in different colours used, and these initials are displayed superscripted after the changed text.
\replaced[MI]{new text}{old text}
You can hide the change marks by giving the option final to the changes package.
This is very basic, and comments are not supported, but it might help.
My little home-rolled "fixme" tool uses \marginpar where possible and goes inline in places (like captions) where that is hard to arrange. This works out because I don't often use margin paragraphs for other things. This does mean you can't finalize the layout until everything is fixed, but I don't feel much pain from that...
Other than that I heartily agree with Michael about using standard tools and version control.
See also:
Tips for collaboratively editing a LaTeX document (which addresses you main question...)
https://stackoverflow.com/questions/193298/best-practices-in-latex
and a self-plug:
How do I get Emacs to fill sentences, but not paragraphs?
You could also try the trackchanges package.
You can use the changebar package to highlight areas of text that have been affected.
If you don't want to do the markup manually (which can be tedious and interrupt the flow of editing) the neat latexdiff utility will take a diff of your document and produce a version of it with markup added to visually display the changes between the two versions in the typeset output.
This would be my preferred solution, although I haven't tested it out on large, multi-file documents.
The best package I know is Easy Review that provides the commenting functionality into LaTeX environment. For example, you can use the following simple commands such as \add{NEW TEXT}, \remove{OLD TEXT}, \replace{OLD TEXT}{NEW TEXT}, \comment{TEXT}{COMMENT}, \highlight{TEXT}, and \alert{TEXT}.
Some examples can be found here.
The todonotes package looks great, but if that proves too cumbersome to use, a simple solution is just to use footnotes (e.g. in red to separate them from regular footnotes).
Package trackchanges.sty works exactly the way changes.sty. See #Svante's reply.
It has easy to remember commands and you can change how edits will appear after compiling the document. You can also hide the edits for printing.

Resources