git-log | A Atom package for git commit graphs
kandi X-RAY | git-log Summary
kandi X-RAY | git-log Summary
A Atom package for git commit graphs
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of git-log
git-log Key Features
git-log Examples and Code Snippets
Community Discussions
Trending Discussions on git-log
QUESTION
I'm trying to write a function that allows me to toggle TPope's Vim Fugitive git-log viewer.
The plugin allows you to view the history of your project, by opening up git objects as buffers that begin with fugitive://
I'm trying to write a function in vimscript that will allow me to close all of these buffers at once, when they're open. The function currently looks like this, and is quite close to working:
...ANSWER
Answered 2021-May-21 at 21:17How about the following?
QUESTION
Listing the most recent tag of a remote repository produces a different answer from cloning that repository and then describing its tags. E.g.
...ANSWER
Answered 2021-May-13 at 21:17I believe what you want is the first token from the output of git describe --tags
.
The two commands serve different purposes.
git ls-remote
lists the references on a remote repository, but does not make any promises about the ordering in which they are listed. Sure, the most recent one is typically last, but it's not necessarily the most relevant one, especially if that tag was on a branch that didn't get merged yet.
git describe
, on the other hand, is trying to give you a concise description of HEAD
(by default, or the commit you specify) with respect to the most recent tag reachable from there. If you use your tags only for stable commits, then that's probably going to be the tag you want. Then, once it found that tag, it tells you how many more commits are in HEAD
, 606 of them in your example, then "g" (not sure why), then the sha1 of HEAD
. This is meant to be a human-readable description of any commit, as in, "oh, you're 606 commits ahead of v2.31.1", but also an unambiguous description, since you get the sha1.
As for adding the --tags
option to git describe
, you need it if you have tags without annotations, e.g., if some where created using git tag
instead of git tag -a
. The latter is preferable, since it allows the tagger to describe the contents of the tag, but you can't always count on everyone using it. So it's probably a good idea to add --tags
to git describe
.
If your repo only contains tags for stable releases, and those releases are not on a different release branch, and you never have hyphens in your tag names, then this would be the most recent stable release that's a parent of HEAD
:
QUESTION
Related to How does `git log --all --graph` get the branch pattern
I am having trouble understanding how git log --graph
creates a graph of a git history with a correct distinction between branches. Given the simple example of a master and a topic branch, I do not understand how git notices that the commits of the topic branch were not made on the master branch.
The related question linked above describes how a graph is created; the essence is that each commit points to at least one parent, and that fact yields a graph. What I do not understand is how git determines the difference between the following two (sketches of) graphs.
...ANSWER
Answered 2021-Apr-21 at 16:53Two reasons:
First: your first graph assumes that the branch topic
is still around, and still points to C
, which allows that segment of the graph to actually be labeled topic
. If the branch was deleted, the graph would still be the same (and the merge commit would still probably say merge branch 'topic'
), but the branch itself wouldn't have a label at its head.
Second: a commit can have multiple parents, but those parents aren't all equal; they're ordered. When you do git merge
, the merge commit that's created will have the branch-merged-into as its first parent, and the branch-merged-in as its second parent. git log
assumes this convention when it makes graphs: the first parent of a commit will be on the side that "continues straight", while the second parent will be on the side that "branches off". You can hand-craft a commit that violates this convention, and makes the graph do weird things, but there's not much reason to.
QUESTION
Say I have a git-cc
executable in PATH
. If git-cc
supports --help
, then it is easy to provide adequate completion with
ANSWER
Answered 2021-Apr-07 at 13:49What to do?
Just define a function that does the compiletion with leading _git_
prefix.
QUESTION
There are many times where I have one project bring another repository in as a subtree. This is great and works fine, but it complicates git-log because I end up seeing this unbelievably-long history associated with the subtree and it's placed above the history of my branch, making it much harder to see what's going on in my branch/master/etc.
Is there a way to tell git-log to ignore all commits reachable by a certain commit? I'm thinking of making a project-specific pretty-log script that knows some of the commit IDs of the things subtree'd-in so I can have it automatically filter those out and show me a more-useful git-log.
...ANSWER
Answered 2021-Mar-24 at 13:19In your situation with a subtree : @ChrisMaes comment linking to how to ignore a directory is a good suggestion.
Yes, you tell git log
to ignore a commit and its parent.
Quoting git help log
:
Thus, the following command:
QUESTION
As already answered in git log abbreviated format length, the length of %h in git log can be changed. However, my question is where is the default length stored?
I defined an git alias like this:
...ANSWER
Answered 2021-Feb-08 at 12:30Git will read the core.abbrev
setting, if you've set it. If not, or if you set it to the literal string auto
, the default is to compute an approximation, dynamically, based on the number of objects—well, an approximation of that number—in the Git repository, of a length that will be suitable as Lasse V. Karlsen noted in comments.
The git config
documentation describes it this way:
core.abbrev
Set the length object names are abbreviated to. If unspecified or set to "auto", an appropriate value is computed based on the approximate number of packed objects in your repository, which hopefully is enough for abbreviated object names to stay unique for some time. The minimum length is 4.
You mention that you have:
... two different repositories, one is showing 9 characters hash abbreviation [vs the more usual 7]
7 is the default minimum from the internal calculation (which uses a rough approximation of log2 of the approximated object count); the one with 9 must have many more objects in it than the others. As the documentation says, the goal is to produce an abbreviation that will still work even once the repository grows, so if it's estimating 9 now, there's a good chance that 7 still works now, but maybe won't by next year.
QUESTION
There is a piece of code in my project that relies on the output of this command:
...ANSWER
Answered 2021-Jan-23 at 01:51The internal git log
algorithm is to insert "new" (unvisited) commits into a priority queue. The overall loop is:
QUESTION
I try to interactive rebase some commits. My git-log looks something like this
...ANSWER
Answered 2020-Jul-14 at 13:32A stupid thing to try : add an extra commit at the tip of your current branch, where you rename the problematic paths to paths that will not conflict :
QUESTION
In order to find commits on branch working
not merged/picked to master
yet I'm running
ANSWER
Answered 2020-Dec-16 at 11:08As ElpieKay mentioned in a comment, you need the three-dot notation. However, just adding the three-dot notation is not sufficient: you will also want to add --left-only
or --right-only
(depending on which side of the symmetric difference you put the A
and B
parts, of A...B
, on).
Note:
In order to find commits on branch
working
not merged/picked tomaster
yet [I used]master..working
So here, you'd want --right-only master...working
. You can keep --no-merges
as well. If the merges only show up on master
you don't actually need --no-merges
, but it's probably harmless. Note, however, that --no-merges
completely eliminates all merges, regardless of their patch-IDs.
QUESTION
I am stuck at this error. I have tried to search a bunch of things, i tried following the call using debugger. I am none the wiser.
My problem:
I run this command from command line
...ANSWER
Answered 2020-Nov-30 at 17:58Add --decorate=full
or --decorate=short
to your git log
arguments. You can also use --decorate=true
or --decorate=1
, but full
and short
are the documented value these days. Full includes the full name (e.g., refs/heads/somebranch
) while short
shortens to branch or tag names.
The default log.decorate
setting is auto
(since Git 2.9 anyway; before that it was no
/0
/false
, and at various points various bugs were introduced and then fixed in later versions; it's been stable since Git 2.13). The auto
setting mean short
if a human is reading the output, no
if a program is reading the output.1
The decorations themselves are required (i.e., must be turned on) for --simplify-by-decoration --decorate-refs=...
to work. Probably either of these options should imply --decorate=short
if it's currently still auto
from being unset in the Git configuration.2
This all points to a more general problem with using git log
programmatically, e.g., from Python with subprocess
: git log
is what Git calls a porcelain command, which means it obeys user configurations. If the user has a log.decorate
setting, that overrides any defaults. Now that you know about log.decorate
and the --decorate=
argument, you can force correct behavior in your program using the --decorate=
argument (which overrides any user configuration). But what other user-configurable items exist in git log
that could break your program? What about future versions of Git, where git log
might acquire new configuration items? There is nothing you can do about this more-general problem today, unfortunately, but since some things that git log
does cannot be done by any of the so-called plumbing commands—these are commands that don't change behavior based on user configuration, and hence are useful from other programs as they have a known, fixed output format—git log
needs an option to make it behave well. (The git status
command has the --porcelain
option for this; git log
just needs its own version of that.)
1Git doesn't actually know if a human is reading the output. Instead, it approximates this by examining the standard output stream: if the standard output (file descriptor 1) responds with a true value for the isatty
C library call, or git log
output is being fed to a pager, it assumes a human is reading the output. Use of pipes in subprocess
means that stdout is not a tty, which by default disables the pager too. However, there's a user configuration setting that forces the pager to be used: see the "more general problem" paragraph.
2In general, the way Git configurations work is this:
First, the program sets any automatic defaults, such as
log.decorate=auto
(this is typically just open-coded, rather than using the configuration mechanism).Next, Git reads the system configuration file. If this has a setting such as
log.decorate=short
in it, that setting applies, overriding the automatic default. (This usually works through callbacks, from the configuration mechanism to the program.)Next, Git reads your personal global configuration file. If this has a setting such as
log.decorate=auto
in it, that setting applies. If the previous configuration had a setting, this overwrites that previous setting.Next, Git reads the configuration file for this particular Git repository. If this has a setting such as
log.decorate=full
, that setting applies, overwriting any previous setting as before.Last, Git applies command-line argument settings. These therefore override any settings picked up in any of the previous steps.
This is how, for instance, you can arrange your user.name
and/or user.email
to be different for one particular Git repository. You set these in your global config, which Git reads before it reads the per-repository config; then you set them to the different value in the per-repository config, and that overrides the global config.
In relatively recent versions of Git, you can also set up a per-worktree configuration: git config --worktree
. This is read after the per-repository config file, but used before command line arguments, so it has the second-highest priority. For the per-worktree setting to take effect, you must enable extensions.worktreeConfig
. Be careful here as there were some bugs with this extension for a little while.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install git-log
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page