我想最后显示带有前缀“ Pv1”的标签。
我只能按顺序列出大包,但由于我想取消登台标签,因此无法使用前缀添加它们。使用以下命令。
git for-each-ref --format="%(refname)" --sort=-taggerdate --count=10 refs
并获得以下结果。
refs/tags/Pv1.155.0
refs/tags/QAv1.154.1
refs/tags/Pv1.154.0
refs/tags/QAv1.153.1
refs/tags/Pv1.153.0
refs/tags/Pv1.152.0
refs/tags/QAv1.151.1
refs/tags/Pv1.151.0
refs/tags/QAv1.150.1
refs/tags/Pv1.150.0_p1
但是我只想添加“ Pv1”标签。我想要它们作为shell脚本。我不希望它grep然后过滤。我尝试--contains=
总线无法成功执行命令。
答案 0 :(得分:1)
non-dash-prefixed arguments to git for-each-ref
是glob patterns:
<模式> ...
如果给出了一个或多个模式,则仅使用fnmatch(3)或从字面上显示仅与至少一个模式匹配的ref,在后一种情况下,则完全或从斜线开始完全匹配。
因此,您只需要一个匹配ERROR: (gcloud.ml-engine.local.predict) /usr/local/lib/python2.7/dist-packages/requests/__init__.py:83:
2018-10-03 09:20:06.598090: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
ERROR:root:Exception during running the graph: invalid literal for long() with base 10: '\xff\xd8\xff\xdb'
Traceback (most recent call last):
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/command_lib/ml_engine/local_predict.py", line 172, in <module>
main()
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/command_lib/ml_engine/local_predict.py", line 167, in main
signature_name=args.signature_name)
File "/usr/lib/google-cloud-sdk/lib/third_party/ml_sdk/cloud/ml/prediction/prediction_lib.py", line 106, in local_predict
predictions = model.predict(instances, signature_name=signature_name)
File "/usr/lib/google-cloud-sdk/lib/third_party/ml_sdk/cloud/ml/prediction/prediction_utils.py", line 233, in predict
preprocessed, stats=stats, **kwargs)
File "/usr/lib/google-cloud-sdk/lib/third_party/ml_sdk/cloud/ml/prediction/frameworks/tf_prediction_lib.py", line 350, in predict
"Exception during running the graph: " + str(e))
cloud.ml.prediction.prediction_utils.PredictionError: Failed to run the provided model: Exception during running the graph: invalid literal for long() with base 10: '\xff\xd8\xff\xdb' (Error code: 2)
的glob模式,当然就是refs/tags/Pv1*
。
(请注意,如果您没有在refs/tags/Pv1*
模式中包含任何glob模式字符,Git会在您的末尾添加for-each-ref
。换句话说,/*
是等效的到git for-each-ref refs/heads
。Git足够聪明,不会添加额外的斜杠,因此您可以根据需要写git for-each-ref refs/heads/*
。)