Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Documentation/MyFirstContribution.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ But as we drill down, we can find that `status_init_config()` wraps a call
to `git_config()`. Let's modify the code we wrote in the previous commit.

Be sure to include the header to allow you to use `struct wt_status`:

----
#include "wt-status.h"
----
Expand Down
2 changes: 2 additions & 0 deletions Documentation/MyFirstObjectWalk.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ static void final_rev_info_setup(struct rev_info *rev)
====
Instead of using the shorthand `add_head_to_pending()`, you could do
something like this:

----
struct setup_revision_opt opt;

Expand All @@ -295,6 +296,7 @@ something like this:
opt.revarg_opt = REVARG_COMMITTISH;
setup_revisions(argc, argv, rev, &opt);
----

Using a `setup_revision_opt` gives you finer control over your walk's starting
point.
====
Expand Down
1 change: 1 addition & 0 deletions Documentation/ToolsForGit.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ This is adapted from Linux's suggestion in its CodingStyle document:

- To follow the rules in CodingGuidelines, it's useful to put the following in
GIT_CHECKOUT/.dir-locals.el, assuming you use cperl-mode:

----
;; note the first part is useful for C editing, too
((nil . ((indent-tabs-mode . t)
Expand Down
1 change: 1 addition & 0 deletions Documentation/git-bisect.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ $ git bisect old HEAD~10 # the tenth commit from now is marked as old
------------
+
or:
+
------------
$ git bisect start --term-old broken --term-new fixed
$ git bisect fixed
Expand Down
4 changes: 2 additions & 2 deletions Documentation/git-cat-file.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ of `%(objectsize)` bytes), followed by a newline.

For example, `--batch` without a custom format would produce:

------------
-----------
<oid> SP <type> SP <size> LF
<contents> LF
------------
-----------

Whereas `--batch-check='%(objectname) %(objecttype)'` would produce:

Expand Down
6 changes: 6 additions & 0 deletions Documentation/git-check-attr.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,22 @@ EXAMPLES
--------

In the examples, the following '.gitattributes' file is used:

---------------
*.java diff=java -crlf myAttr
NoMyAttr.java !myAttr
README caveat=unspecified
---------------

* Listing a single attribute:
+
---------------
$ git check-attr diff org/example/MyClass.java
org/example/MyClass.java: diff: java
---------------

* Listing multiple attributes for a file:
+
---------------
$ git check-attr crlf diff myAttr -- org/example/MyClass.java
org/example/MyClass.java: crlf: unset
Expand All @@ -97,20 +100,23 @@ org/example/MyClass.java: myAttr: set
---------------

* Listing all attributes for a file:
+
---------------
$ git check-attr --all -- org/example/MyClass.java
org/example/MyClass.java: diff: java
org/example/MyClass.java: myAttr: set
---------------

* Listing an attribute for multiple files:
+
---------------
$ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java
org/example/MyClass.java: myAttr: set
org/example/NoMyAttr.java: myAttr: unspecified
---------------

* Not all values are equally unambiguous:
+
---------------
$ git check-attr caveat README
README: caveat: unspecified
Expand Down
3 changes: 3 additions & 0 deletions Documentation/git-column.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ EXAMPLES
--------

Format data by columns:
+
------------
$ seq 1 24 | git column --mode=column --padding=5
1 4 7 10 13 16 19 22
Expand All @@ -58,6 +59,7 @@ $ seq 1 24 | git column --mode=column --padding=5
------------

Format data by rows:
+
------------
$ seq 1 21 | git column --mode=row --padding=5
1 2 3 4 5 6 7
Expand All @@ -66,6 +68,7 @@ $ seq 1 21 | git column --mode=row --padding=5
------------

List some tags in a table with unequal column widths:
+
------------
$ git tag --list 'v2.4.*' --column=row,dense
v2.4.0 v2.4.0-rc0 v2.4.0-rc1 v2.4.0-rc2 v2.4.0-rc3
Expand Down
4 changes: 4 additions & 0 deletions Documentation/git-cvsserver.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ creation in your platform (e.g. mkpasswd in Linux, encrypt in OpenBSD or
pwhash in NetBSD) and paste it in the right location.

Then provide your password via the pserver method, for example:

------
cvs -d:pserver:someuser:somepassword@server:/path/repo.git co <HEAD_name>
------

No special setup is needed for SSH access, other than having Git tools
in the PATH. If you have clients that do not accept the CVS_SERVER
environment variable, you can rename 'git-cvsserver' to `cvs`.
Expand All @@ -138,6 +140,7 @@ CVS_SERVER directly in CVSROOT like
------
cvs -d ":ext;CVS_SERVER=git cvsserver:user@server/path/repo.git" co <HEAD_name>
------

This has the advantage that it will be saved in your 'CVS/Root' files and
you don't need to worry about always setting the correct environment
variable. SSH users restricted to 'git-shell' don't need to override the default
Expand Down Expand Up @@ -168,6 +171,7 @@ All configuration variables can also be overridden for a specific method of
access. Valid method names are "ext" (for SSH access) and "pserver". The
following example configuration would disable pserver access while still
allowing access over SSH.

------
[gitcvs]
enabled=0
Expand Down
2 changes: 2 additions & 0 deletions Documentation/git-for-each-ref.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ Ref: %(*refname)

A simple example showing the use of shell eval on the output,
demonstrating the use of --shell. List the prefixes of all heads:

------------
#!/bin/sh

Expand All @@ -455,6 +456,7 @@ done

A bit more elaborate report on tags, demonstrating that the format
may be an entire script:

------------
#!/bin/sh

Expand Down
14 changes: 14 additions & 0 deletions Documentation/git-p4.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ This:

To reproduce the entire p4 history in Git, use the '@all' modifier on
the depot path:

------------
$ git p4 clone //depot/path/project@all
------------
Expand All @@ -89,19 +90,23 @@ Sync
~~~~
As development continues in the p4 repository, those changes can
be included in the Git repository using:

------------
$ git p4 sync
------------

This command finds new changes in p4 and imports them as Git commits.

P4 repositories can be added to an existing Git repository using
'git p4 sync' too:

------------
$ mkdir repo-git
$ cd repo-git
$ git init
$ git p4 sync //path/in/your/perforce/depot
------------

This imports the specified depot into
'refs/remotes/p4/master' in an existing Git repository. The
`--branch` option can be used to specify a different branch to
Expand All @@ -125,6 +130,7 @@ and merge them with local uncommitted changes. Often, the p4 repository
is the ultimate location for all code, thus a rebase workflow makes
sense. This command does 'git p4 sync' followed by 'git rebase' to move
local commits on top of updated p4 changes.

------------
$ git p4 rebase
------------
Expand All @@ -140,16 +146,19 @@ will be created and populated if it does not already exist.

To submit all changes that are in the current Git branch but not in
the 'p4/master' branch, use:

------------
$ git p4 submit
------------

To specify a branch other than the current one, use:

------------
$ git p4 submit topicbranch
------------

To specify a single commit or a range of commits, use:

------------
$ git p4 submit --commit <sha1>
$ git p4 submit --commit <sha1..sha1>
Expand Down Expand Up @@ -510,20 +519,24 @@ when cloning or syncing to have 'git p4' automatically find
subdirectories in p4, and to generate these as branches in Git.

For example, if the P4 repository structure is:

----
//depot/main/...
//depot/branch1/...
----

And "p4 branch -o branch1" shows a View line that looks like:

----
//depot/main/... //depot/branch1/...
----

Then this 'git p4 clone' command:

----
git p4 clone --detect-branches //depot@all
----

produces a separate branch in 'refs/remotes/p4/' for //depot/main,
called 'master', and one for //depot/branch1 called 'depot/branch1'.

Expand All @@ -536,6 +549,7 @@ simple p4 branch specification, where the "source" and "destination" are
the path elements in the p4 repository. The example above relied on the
presence of the p4 branch. Without p4 branches, the same result will
occur with:

----
git init depot
cd depot
Expand Down
3 changes: 3 additions & 0 deletions Documentation/git-rebase.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1107,10 +1107,12 @@ In that case, the fix is easy because 'git rebase' knows to skip
changes that are already present in the new upstream (unless
`--reapply-cherry-picks` is given). So if you say
(assuming you're on 'topic')

------------
$ git rebase subsystem
------------
you will end up with the fixed history

------------
o---o---o---o---o---o---o---o master
\
Expand Down Expand Up @@ -1145,6 +1147,7 @@ of the old 'subsystem', for example:

You can then transplant the old `subsystem..topic` to the new tip by
saying (for the reflog case, and assuming you are on 'topic' already):

------------
$ git rebase --onto subsystem subsystem@{1}
------------
Expand Down
24 changes: 16 additions & 8 deletions Documentation/gitattributes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -531,13 +531,14 @@ must not send any response before it received the content and the
final flush packet. Also note that the "value" of a "key=value" pair
can contain the "=" character whereas the key would never contain
that character.
------------------------

-----------------------
packet: git> command=smudge
packet: git> pathname=path/testfile.dat
packet: git> 0000
packet: git> CONTENT
packet: git> 0000
------------------------
-----------------------

The filter is expected to respond with a list of "key=value" pairs
terminated with a flush packet. If the filter does not experience
Expand All @@ -559,6 +560,7 @@ packet: git< 0000 # empty list, keep "status=success" unchanged!

If the result content is empty then the filter is expected to respond
with a "success" status and a flush packet to signal the empty content.

------------------------
packet: git< status=success
packet: git< 0000
Expand All @@ -568,14 +570,16 @@ packet: git< 0000 # empty list, keep "status=success" unchanged!

In case the filter cannot or does not want to process the content,
it is expected to respond with an "error" status.
------------------------

-----------------------
packet: git< status=error
packet: git< 0000
------------------------
-----------------------

If the filter experiences an error during processing, then it can
send the status "error" after the content was (partially or
completely) sent.

------------------------
packet: git< status=success
packet: git< 0000
Expand All @@ -589,10 +593,11 @@ In case the filter cannot or does not want to process the content
as well as any future content for the lifetime of the Git process,
then it is expected to respond with an "abort" status at any point
in the protocol.
------------------------

-----------------------
packet: git< status=abort
packet: git< 0000
------------------------
-----------------------

Git neither stops nor restarts the filter process in case the
"error"/"abort" status is set. However, Git sets its exit code
Expand All @@ -613,7 +618,8 @@ flag "can-delay" after the filter command and pathname. This flag
denotes that the filter can delay filtering the current blob (e.g. to
compensate network latencies) by responding with no content but with
the status "delayed" and a flush packet.
------------------------

-----------------------
packet: git> command=smudge
packet: git> pathname=path/testfile.dat
packet: git> can-delay=1
Expand All @@ -622,7 +628,7 @@ packet: git> CONTENT
packet: git> 0000
packet: git< status=delayed
packet: git< 0000
------------------------
-----------------------

If the filter supports the "delay" capability then it must support the
"list_available_blobs" command. If Git sends this command, then the
Expand All @@ -647,10 +653,12 @@ packet: git< status=success
packet: git< 0000
------------------------


After Git received the pathnames, it will request the corresponding
blobs again. These requests contain a pathname and an empty content
section. The filter is expected to respond with the smudged content
in the usual way as explained above.

------------------------
packet: git> command=smudge
packet: git> pathname=path/testfile.dat
Expand Down
2 changes: 1 addition & 1 deletion Documentation/gitcli.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ $ git foo -o Arg

However, this is *NOT* allowed for switches with an optional value, where the
'stuck' form must be used:

----------------------------
$ git describe --abbrev HEAD # correct
$ git describe --abbrev=10 HEAD # correct
$ git describe --abbrev 10 HEAD # NOT WHAT YOU MEANT
----------------------------


NOTES ON FREQUENTLY CONFUSED OPTIONS
------------------------------------

Expand Down
Loading
Loading