标签云

微信群

扫码加入我们

WeChat QR Code


I cannot imagine how it come that the most used corporate SCM tool is missing this functionality. Probably all their developers are using only the GUI.

2018年09月26日16分46秒

Oh for crying out loud!!!! The accepted p4 status doesn't just FIND untracked files, it actually STARTS TRACKING THEM. I.e. p4 status is not a read-only query, as one would suspect from the name, but is actually a command that changes stuff - not the workspace files. This is NOT what a status command should do, and NOT what svn status does. The closest thing I can find to svn status is p4 reconcile -na - -a to say "files that should be added", -n to say "don't actually change anything". /// I originally said something much stronger.

2018年09月26日16分46秒

I revived stackoverflow.com/questions/9642531/…, which was incorrectly marked as a duplicate of stackoverflow.com/questions/9272/…, as new question (What is the p4 command equivalent to something like git/hg/bzr/svn status? (Hint: not p4 status), and answered it myself. Better welcomed

2018年09月26日16分46秒

Awesome. Thanks for the update!

2018年09月27日16分46秒

Added a powershell solution in this question: stackoverflow.com/questions/3217152/…

2018年09月26日16分46秒

Does this diff every single file against the version in the repo? I've got a large repo and a slow connection (when working from home). This could take forever!

2018年09月27日16分46秒

is there a command-line version ? :)

2018年09月27日16分46秒

Oh for crying out loud!!!! p4 status doesn't just FIND untracked files, it actually STARTS TRACKING THEM. I.e. p4 status is not a read-only query, as one would suspect from the name, but is actually a command that changes stuff - not the workspace files. This is NOT what a status command should do, and NOT what svn status does. The closest thing I can find to svn status is p4 reconcile -na - -a to say "files that should be added", -n to say "don't actually change anything". /// I originally said something much stronger.

2018年09月26日16分46秒

Redirecting stderr to stdout will allow you to perform additional filtering or other operations. For example, to see a scrollable list of Java files: find . -type f -print0 | xargs -0 p4 fstat 2>&1 >/dev/null | grep '\.java ' | less

2018年09月26日16分46秒

This takes insanely long on my 60K-files workspace. I have written a python script which does the same job in under 10 seconds: p5. It also supports .p4ignore and can preview and automatically edit untracked/changed/deleted files.

2018年09月27日16分46秒

hamstergene, very nice!

2018年09月27日16分46秒

Wrote a small script that does exactly that if anyone is interested (including dir argument, max depth argument & output to stdout).

2018年09月27日16分46秒

Thanks; I found this useful! Note that this doesn't handle symlinks (find . -type l), and gives misleading output for P4 files forcibly added because they contain the or % characters. However, such files are in the minority, so a manual review of these edge cases will work in most cases.

2018年09月27日16分46秒

I really like this solution. It works very well.

2018年09月26日16分46秒

There have been several performance improvements to p4 status since the 2012.1 release. If you have been staying away from p4 status due to performance concerns, it might be worth testing it again to see how it behaves now.

2018年09月27日16分46秒

p4 status doesn't seem to add files. it appears to work like and is documented as 'reconcile -n'. are you sure it changes things?

2018年09月27日16分46秒

This is a great solution, and still works with P4 version 2015.1

2018年09月27日16分46秒

very fast! find/xargs runs out of memory and slow. Recall to double %'s when adding to .bat file.

2018年09月27日16分46秒

This only shows files under the current directory, sadly :(

2018年09月27日16分46秒

Quick enough to warrant an upvote - but dirty.

2018年09月26日16分46秒

Please do not just throw some code without any explanation as answer but add some explanation to help the OP understanding the code and learn something. :)

2018年09月26日16分46秒