Comments (8)
@mmatrosov The resolver for this simply calls git symbolic-ref --short -q HEAD
. What does it return in your case? I'd just need to know what is the condition to check for to show detached HEAD
(which indeed seems appropriate).
from vs-customize-window-title.
What does it return in your case?
Empty string.
I'd just need to know what is the condition to check for to show detached HEAD
From the docs:
-q
--quiet
Do not issue an error message if the is not a symbolic ref but a detached HEAD; instead exit with non-zero status silently.
Thus it seems like you can either remove -q
and parse the error message, or check for the return status.
from vs-customize-window-title.
How can we reliably determine that it is a detached HEAD (and not another error)?
from vs-customize-window-title.
In your case, what does the command return when you remove -q
?
from vs-customize-window-title.
How can we reliably determine that it is a detached HEAD (and not another error)?
I'm not sure. Need to investigate.
In your case, what does the command return when you remove -q?
$ git symbolic-ref --short HEAD
fatal: ref HEAD is not a symbolic ref
from vs-customize-window-title.
Is there a separate command we can run to easily check if we're on a detached HEAD (if so, I could run it when the branchName is blank)?
from vs-customize-window-title.
I was not able to find a dedicated command line for this.
It seems ok to rely on the fact that symbolic-ref
return non-zero status if and only if we are in the detached head state. That's what is written in the docs after all.
from vs-customize-window-title.
Implementing this with today's release. Let me know if it doesn't work as expected!
Thanks for your help.
from vs-customize-window-title.
Related Issues (20)
- VS 2019 16.2.x freezes (at least on solution/VS close) HOT 7
- Colorize the Title Bar/Change Themes HOT 1
- Show focused tool window? HOT 11
- Get BranchName out of svnDirectoryName HOT 7
- Add path arguments for git branch name HOT 1
- Support title in compact menu HOT 2
- Issue with [svnDirectoryName] not working HOT 10
- Add [solutionFilterName] in addition to [solutionName] HOT 1
- Customizable timer HOT 2
- Support for VS 2022 HOT 21
- [vsMajorVersionYear] is "17" in Visual Studio 2022 HOT 1
- Minimizing/restoring VS 2022 window via task bar not working HOT 4
- Contributing/Setup HOT 1
- Feature request - Allow to remove prefixes separated with dot character HOT 2
- Added new DebuggedProcessesExesResolver
- Adding "Substring" functionality HOT 1
- [gitBranchName] does not work for CMake project opened as folder
- Customizable Font Family HOT 1
- Truncation ability
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vs-customize-window-title.