Skip to content

Commit fc87f04

Browse files
committed
fixup! Introduce repo.Describe()
1 parent bc469a7 commit fc87f04

4 files changed

Lines changed: 34 additions & 2 deletions

File tree

LibGit2Sharp/DescribeOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public DescribeOptions()
2424
}
2525

2626
/// <summary>
27-
/// The kind of references that will be elligible as reference points.
27+
/// The kind of references that will be eligible as reference points.
2828
/// </summary>
2929
public DescribeStrategy Strategy { get; set; }
3030

LibGit2Sharp/IRepository.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,22 @@ public interface IRepository : IDisposable
366366
/// <returns>A <see cref="RepositoryStatus"/> holding the state of all the files.</returns>
367367
RepositoryStatus RetrieveStatus(StatusOptions options);
368368

369+
/// <summary>
370+
/// Finds the most recent annotated tag that is reachable from a commit.
371+
/// <para>
372+
/// If the tag points to the commit, then only the tag is shown. Otherwise,
373+
/// it suffixes the tag name with the number of additional commits on top
374+
/// of the tagged object and the abbreviated object name of the most recent commit.
375+
/// </para>
376+
/// <para>
377+
/// Optionally, the <paramref name="options"/> parameter allow to tweak the
378+
/// search strategy (considering lightweith tags, or even branches as reference points)
379+
/// and the formatting of the returned identifier.
380+
/// </para>
381+
/// </summary>
382+
/// <param name="commit">The commit to be described.</param>
383+
/// <param name="options">Determines how the commit will be described.</param>
384+
/// <returns>A descriptive identifier for the commit based on the nearest annotated tag.</returns>
369385
string Describe(Commit commit, DescribeOptions options);
370386
}
371387
}

LibGit2Sharp/Repository.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,22 @@ private IEnumerable<string> RemoveStagedItems(IEnumerable<string> paths, bool re
18911891
return removed;
18921892
}
18931893

1894+
/// <summary>
1895+
/// Finds the most recent annotated tag that is reachable from a commit.
1896+
/// <para>
1897+
/// If the tag points to the commit, then only the tag is shown. Otherwise,
1898+
/// it suffixes the tag name with the number of additional commits on top
1899+
/// of the tagged object and the abbreviated object name of the most recent commit.
1900+
/// </para>
1901+
/// <para>
1902+
/// Optionally, the <paramref name="options"/> parameter allow to tweak the
1903+
/// search strategy (considering lightweith tags, or even branches as reference points)
1904+
/// and the formatting of the returned identifier.
1905+
/// </para>
1906+
/// </summary>
1907+
/// <param name="commit">The commit to be described.</param>
1908+
/// <param name="options">Determines how the commit will be described.</param>
1909+
/// <returns>A descriptive identifier for the commit based on the nearest annotated tag.</returns>
18941910
public string Describe(Commit commit, DescribeOptions options)
18951911
{
18961912
Ensure.ArgumentNotNull(commit, "commit");

LibGit2Sharp/RepositoryExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ public static RepositoryStatus RetrieveStatus(this IRepository repository)
749749
/// </summary>
750750
/// <param name="repository">The <see cref="IRepository"/> being worked with.</param>
751751
/// <param name="commit">The commit to be described.</param>
752-
/// <returns>A formatted string providing </returns>
752+
/// <returns>A descriptive identifier for the commit based on the nearest annotated tag.</returns>
753753
public static string Describe(this IRepository repository, Commit commit)
754754
{
755755
return repository.Describe(commit, new DescribeOptions());

0 commit comments

Comments
 (0)