How to search commit history? - github

Is there any way to find when the function "_make_parser_function" was introduced in the file pandas/pandas/io/parsers.py?
I tried to search within commit history, but could not find the exact date on which this change was introduced. I guess this function was not available in older versions of pandas.
https://github.com/pandas-dev/pandas/commits/71334472766fc95e7dc828dce2bfe798f6bb19dc?before=71334472766fc95e7dc828dce2bfe798f6bb19dc+35&path%5B%5D=pandas&path%5B%5D=io&path%5B%5D=parsers.py

Try -L option
# git log -L :myfunction:path/to/myfile.c
git log -L :_make_parser_function:pandas/io/parsers.py

Related

How do I check the previous version of a file after I have changed its version in cvs?

I did a cvs update -r "1.5" on file abc.html. The abc.html has versions until 1.10. The previous version it was in was v1.8.
Let's say I had no idea it was in v1.8 after I changed its version to v1.5. How do I use cvs to find out that the previous version of the file used was v1.8?
Or in other words, how do I use cvs to track all previous change in file version?
It's very hard to know what you mean from the wording of your question, but I think this is it... You had a workspace that was a bit old. abc.html was at version 1.8. Then you did cvs update -r 1.5 abc.html and now you want to undo that operation and get back to the version that corresponds to the date of checkout of the rest of the files in your repository. The short answer is that you cannot. CVS tracks changes on a per-file basis, not a per-directory one. Unless you know the timestamp of when you checked out the whole repository, or you have a tag that was applied to the whole repository that you were checked out to, what you want can't really be done.
Other possible things you might have meant:
The previous version to 1.x is 1.(x-1).
How many versions are there? cvs log <filename>.
What version does the current workspace have checked out? cvs status abc.html.
note: You probably do not want to do cvs update -r 1.5 abc.html as that will put a "sticky tag" on the file and it will be forever stuck at 1.5 even as you update the rest of your repository to the latest versions. For examining old versions of individual files, if cvs diff -r 1.5 abc.html is not enough, I would recommend using -p to send the output to stdout. e.g. cvs update -p -r 1.5 abc.hmtl > abc.html. Or you can even redirect it to /tmp/abc.html.

Get latest revision number of a file from cvs repository

Is there a way to know the latest revision number of a file in cvs repository without checking out that file.
The exact problem is, suppose I know the name of a file which is in cvs repo. Let's call it file1.text.
So, is there any command or any way by which I can search repo for that file and get the latest revision number of that file?
You can use CVS log and give a revision as "starting point":
$ cvs log -r{REVISION}:: file1.text
The -r{REVISION}:: will only search for revisions after {REVISION} (can be a number or tag).
If you don't have a working copy, you can use rls cvs command. With -l argument, it will print the version of files.
$ cvs rls -l MyModule/path/to/the/file
You can use -r to specify a branch.
Here's the command to use:
cvs history -a -c -l module/file1.text
This will display the version and the date the file was last modified. This doesn't require the module or file checked out.

How to get revision number from Mercurial repository and paste it to NetBeans resource bundle?

I have a java project in NetBeans and im using Mercurial for version controlling.
I want to see my project version number in about box and i want it to be updated according to Mercurial revision number.
Any ideas how to do it? :)
Following 'Version numbering for auto builds with Mercurial', you can record in a VERSION.TXT file (that you about dialog would display) the result of:
hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}'
Lazy Badger comments:
log will be a lot better (and correct) with:
hg log -r tip --template "{latesttag}.{latesttagdistance}"
You have more options in "How good is my method of embedding version numbers into my application using Mercurial hooks?"
version_gen.sh with:
hg parent --template "r{node|short}_{date|shortdate}" > version.num
In the makefile, make sure version_gen.sh is run before version.num is used to set the version parameter.
If Windows, MercurialRev ("SubWCRev for Mercurial") may be useful also
Replaces revision information in a tagged text file.
MercurialRev <SourceFile> <DestinationFile> <RepositoryPath>
Tags:
<$HG:REV_NUM$>
<$HG:REV_LMOD_N$>
<$HG:REV_LMOD_P$>
<$HG:REV_ID$>
<$HG:BRANCH$>
<$HG:TAG$>

Perforce command line head revision file

What is the command line syntax to check whether this workspace currently has the latest revision of a certain file?
The command:
p4 sync -n
will preview the sync operation. This will tell you which files would be updated were you to use the actual command.
The command:
p4 have [file]
will tell you the version of the file you currently have. This coupled with:
p4 fstat -T "headRev" [file]
which tells you the head revision number, will tell you whether you have the latest version or not.
It's worth noting that all Perforce commands have a preview option that tell you what they would do. This allows you to verify you've got the correct command without fear of corrupting your workspace or depot.

Perforce - How to get the list of files that have been modified locally?

I am looking for a perforce command to get the list of the files that have been modified locally and "not" checked-in to the repository.
I understand that I "should" get the list of modified files in Pending changelist, but there are scenarios when I don't get to see a modified file in that list. And then on "manually" checking out a file and doing a diff i realize the difference.
Is there any command that could check all the files in a given folder and provide me a list of files that are not same as there state in the repository?
I tried "p4 sync", but that did not work.
Thanks for your interest.
Try
p4 diff -f -sa
(see manual for further details)
I use "p4 revert -n ./..."
where
-n
List the files that would be reverted without actually performing the revert.
This lets you make sure the revert does what you think it does before actually reverting the files.
In the recent versions of Perforce, try "p4 reconcile -e"
see: http://www.perforce.com/perforce/r12.1/manuals/cmdref/reconcile.html
It certainly takes its time though (not very fast).
I think, the modified files are submitted locallay (Otherwise, p4 opened ./... will help to find)
If files are already submitted to local perforce and still want to know which all are modified..
p4 changes -m 5 ./... (Should give changes lists)
p4 integrate -n ./... //server/code/base/... (This should list the files to be integrated to mainline.