Commit Graph

10 Commits

Author SHA1 Message Date
Vicent Martí
a605bbd9b4 Merge pull request #1934 from libgit2/relicense-examples
Relicense examples under CC0
2013-11-04 10:14:22 -08:00
Carlos Martín Nieto
becb13c0f0 examples: doc update
Update the explanation to reflect our use of git_status_list_new() and
make the breaks in rocco more meaningful.

Clarify why GIT_STATUS_CURRENT and index_to_workdir don't always imply
each other. Fixes #1740.
2013-11-03 16:20:24 +01:00
Ben Straub
6cb831bd56 Replace copyright topmatter in example files 2013-11-02 05:33:26 -07:00
Ben Straub
85c6730ce8 Format comments for use with docco 2013-10-31 14:35:32 -07:00
Russell Belfer
66902d4773 Extract common example helpers and reorg examples
This reorganizes a few of the examples so that the main function
comes first with the argument parsing extracted into a helper
that can come at the end of the file (so the example focuses more
on the use of libgit2 instead of command line support).  This also
creates a shared examples/common.[ch] so that useful helper funcs
can be shared across examples instead of repeated.
2013-10-29 18:30:49 -07:00
Carlos Martín Nieto
605da51a2c No such thing as an orphan branch
Unfortunately git-core uses the term "unborn branch" and "orphan
branch" interchangeably. However, "orphan" is only really there for
the checkout command, which has the `--orphan` option so it doesn't
actually create the branch.

Branches never have parents, so the distinction of a branch with no
parents is odd to begin with. Crucially, the error messages deal with
unborn branches, so let's use that.
2013-09-17 09:50:30 +02:00
Russell Belfer
9280855787 Fix comment and copyright in example 2013-06-20 15:10:42 -07:00
Russell Belfer
f18f772a8e Add example implementation of long format status 2013-06-20 14:27:14 -07:00
Russell Belfer
22b6b82f2c Add status flags to force output sort order
Files in status will, be default, be sorted according to the case
insensitivity of the filesystem that we're running on.  However,
in some cases, this is not desirable.  Even on case insensitive
file systems, 'git status' at the command line will generally use
a case sensitive sort (like 'ls').  Some GUIs prefer to display a
list of file case insensitively even on case-sensitive platforms.

This adds two new flags: GIT_STATUS_OPT_SORT_CASE_SENSITIVELY
and GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY that will override the
default sort order of the status output and give the user control.
This includes tests for exercising these new options and makes
the examples/status.c program emulate core Git and always use a
case sensitive sort.
2013-06-20 12:16:06 -07:00
Russell Belfer
cf300bb9e5 Initial implementation of status example 2013-06-20 11:39:31 -07:00