feat(folder): add commit reset action in git log
Add a "Reset to Here" context action for git log commit items in the folder page. Show a reset dialog with branch, target commit, commit message, and reset mode details for soft, mixed, hard, and keep. Disable reset when viewing a non-current branch filter and keep the action ordering under commit diff. Add git_reset support across Rust commands, Tauri invoke registration, web handlers/routes, and frontend API/type bindings. Add localized reset labels, mode descriptions, and toast messages across all supported languages.
This commit is contained in:
@@ -1154,6 +1154,36 @@ pub async fn git_checkout(path: String, branch_name: String) -> Result<(), AppCo
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "tauri-runtime", tauri::command)]
|
||||||
|
pub async fn git_reset(
|
||||||
|
path: String,
|
||||||
|
commit: String,
|
||||||
|
mode: String,
|
||||||
|
) -> Result<(), AppCommandError> {
|
||||||
|
let mode = mode.trim().to_lowercase();
|
||||||
|
let mode_flag = match mode.as_str() {
|
||||||
|
"soft" | "mixed" | "hard" | "keep" => format!("--{mode}"),
|
||||||
|
_ => {
|
||||||
|
return Err(AppCommandError::invalid_input(
|
||||||
|
"Reset mode must be one of: soft, mixed, hard, keep",
|
||||||
|
))
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let output = crate::process::tokio_command("git")
|
||||||
|
.args(["reset", mode_flag.as_str(), commit.as_str()])
|
||||||
|
.current_dir(&path)
|
||||||
|
.output()
|
||||||
|
.await
|
||||||
|
.map_err(AppCommandError::io)?;
|
||||||
|
|
||||||
|
if !output.status.success() {
|
||||||
|
return Err(git_command_error("reset", &output.stderr));
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "tauri-runtime", tauri::command)]
|
#[cfg_attr(feature = "tauri-runtime", tauri::command)]
|
||||||
pub async fn git_list_branches(path: String) -> Result<Vec<String>, AppCommandError> {
|
pub async fn git_list_branches(path: String) -> Result<Vec<String>, AppCommandError> {
|
||||||
let output = crate::process::tokio_command("git")
|
let output = crate::process::tokio_command("git")
|
||||||
|
|||||||
@@ -288,6 +288,7 @@ mod tauri_app {
|
|||||||
folders::git_new_branch,
|
folders::git_new_branch,
|
||||||
folders::git_worktree_add,
|
folders::git_worktree_add,
|
||||||
folders::git_checkout,
|
folders::git_checkout,
|
||||||
|
folders::git_reset,
|
||||||
folders::git_list_branches,
|
folders::git_list_branches,
|
||||||
folders::git_stash_push,
|
folders::git_stash_push,
|
||||||
folders::git_stash_pop,
|
folders::git_stash_pop,
|
||||||
|
|||||||
@@ -252,6 +252,21 @@ pub async fn git_checkout(
|
|||||||
Ok(Json(()))
|
Ok(Json(()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct GitResetParams {
|
||||||
|
pub path: String,
|
||||||
|
pub commit: String,
|
||||||
|
pub mode: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn git_reset(
|
||||||
|
Json(params): Json<GitResetParams>,
|
||||||
|
) -> Result<Json<()>, AppCommandError> {
|
||||||
|
folder_commands::git_reset(params.path, params.commit, params.mode).await?;
|
||||||
|
Ok(Json(()))
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn git_list_branches(
|
pub async fn git_list_branches(
|
||||||
Json(params): Json<PathParams>,
|
Json(params): Json<PathParams>,
|
||||||
) -> Result<Json<Vec<String>>, AppCommandError> {
|
) -> Result<Json<Vec<String>>, AppCommandError> {
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ pub fn build_router(state: Arc<AppState>, token: String, static_dir: std::path::
|
|||||||
)
|
)
|
||||||
.route("/git_new_branch", post(handlers::git::git_new_branch))
|
.route("/git_new_branch", post(handlers::git::git_new_branch))
|
||||||
.route("/git_checkout", post(handlers::git::git_checkout))
|
.route("/git_checkout", post(handlers::git::git_checkout))
|
||||||
|
.route("/git_reset", post(handlers::git::git_reset))
|
||||||
.route("/git_delete_branch", post(handlers::git::git_delete_branch))
|
.route("/git_delete_branch", post(handlers::git::git_delete_branch))
|
||||||
.route("/git_merge", post(handlers::git::git_merge))
|
.route("/git_merge", post(handlers::git::git_merge))
|
||||||
.route("/git_rebase", post(handlers::git::git_rebase))
|
.route("/git_rebase", post(handlers::git::git_rebase))
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import {
|
|||||||
GitBranchPlus,
|
GitBranchPlus,
|
||||||
GitCompare,
|
GitCompare,
|
||||||
RefreshCw,
|
RefreshCw,
|
||||||
|
RotateCcw,
|
||||||
Upload,
|
Upload,
|
||||||
} from "lucide-react"
|
} from "lucide-react"
|
||||||
import {
|
import {
|
||||||
@@ -63,6 +64,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@/components/ui/dialog"
|
} from "@/components/ui/dialog"
|
||||||
import { Input } from "@/components/ui/input"
|
import { Input } from "@/components/ui/input"
|
||||||
|
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"
|
||||||
import {
|
import {
|
||||||
Popover,
|
Popover,
|
||||||
PopoverContent,
|
PopoverContent,
|
||||||
@@ -83,13 +85,28 @@ import {
|
|||||||
gitListAllBranches,
|
gitListAllBranches,
|
||||||
gitLog,
|
gitLog,
|
||||||
gitNewBranch,
|
gitNewBranch,
|
||||||
|
gitReset,
|
||||||
openPushWindow,
|
openPushWindow,
|
||||||
} from "@/lib/api"
|
} from "@/lib/api"
|
||||||
import type { GitBranchList, GitLogEntry, GitLogFileChange } from "@/lib/types"
|
import type {
|
||||||
|
GitBranchList,
|
||||||
|
GitLogEntry,
|
||||||
|
GitLogFileChange,
|
||||||
|
GitResetMode,
|
||||||
|
} from "@/lib/types"
|
||||||
import { toast } from "sonner"
|
import { toast } from "sonner"
|
||||||
import { toErrorMessage } from "@/lib/app-error"
|
import { toErrorMessage } from "@/lib/app-error"
|
||||||
import { ScrollArea } from "@/components/ui/scroll-area"
|
import { ScrollArea } from "@/components/ui/scroll-area"
|
||||||
|
|
||||||
|
const emitEvent = async (event: string, payload?: unknown) => {
|
||||||
|
try {
|
||||||
|
const { emit } = await import("@tauri-apps/api/event")
|
||||||
|
await emit(event, payload)
|
||||||
|
} catch {
|
||||||
|
// not in Tauri
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function formatRelativeTime(
|
function formatRelativeTime(
|
||||||
dateStr: string,
|
dateStr: string,
|
||||||
t: (
|
t: (
|
||||||
@@ -211,6 +228,12 @@ interface CommitBranchTarget {
|
|||||||
shortHash: string
|
shortHash: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface CommitResetTarget {
|
||||||
|
fullHash: string
|
||||||
|
shortHash: string
|
||||||
|
message: string
|
||||||
|
}
|
||||||
|
|
||||||
interface MutableCommitFileTreeDirNode {
|
interface MutableCommitFileTreeDirNode {
|
||||||
kind: "dir"
|
kind: "dir"
|
||||||
name: string
|
name: string
|
||||||
@@ -695,6 +718,9 @@ export function GitLogTab() {
|
|||||||
useState<CommitBranchTarget | null>(null)
|
useState<CommitBranchTarget | null>(null)
|
||||||
const [newBranchName, setNewBranchName] = useState("")
|
const [newBranchName, setNewBranchName] = useState("")
|
||||||
const [creatingBranch, setCreatingBranch] = useState(false)
|
const [creatingBranch, setCreatingBranch] = useState(false)
|
||||||
|
const [resetTarget, setResetTarget] = useState<CommitResetTarget | null>(null)
|
||||||
|
const [resetMode, setResetMode] = useState<GitResetMode>("mixed")
|
||||||
|
const [resetting, setResetting] = useState(false)
|
||||||
|
|
||||||
const hasBranches =
|
const hasBranches =
|
||||||
branchList.local.length > 0 || branchList.remote.length > 0
|
branchList.local.length > 0 || branchList.remote.length > 0
|
||||||
@@ -859,6 +885,71 @@ export function GitLogTab() {
|
|||||||
t,
|
t,
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const isResetAllowed = useMemo(() => {
|
||||||
|
return (
|
||||||
|
!!currentBranch && !!selectedBranch && currentBranch === selectedBranch
|
||||||
|
)
|
||||||
|
}, [currentBranch, selectedBranch])
|
||||||
|
|
||||||
|
const handleOpenResetDialog = useCallback((entry: GitLogEntry) => {
|
||||||
|
setResetMode("mixed")
|
||||||
|
setResetTarget({
|
||||||
|
fullHash: entry.full_hash,
|
||||||
|
shortHash: entry.hash,
|
||||||
|
message: entry.message,
|
||||||
|
})
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
const handleResetCurrentBranchToCommit = useCallback(async () => {
|
||||||
|
if (
|
||||||
|
!folder?.path ||
|
||||||
|
!currentBranch ||
|
||||||
|
!resetTarget ||
|
||||||
|
!isResetAllowed ||
|
||||||
|
resetting
|
||||||
|
) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
setResetting(true)
|
||||||
|
try {
|
||||||
|
await gitReset(folder.path, resetTarget.fullHash, resetMode)
|
||||||
|
await refreshBranches(currentBranch)
|
||||||
|
await fetchLog({ inline: true })
|
||||||
|
if (folder.id) {
|
||||||
|
void emitEvent("folder://git-branch-changed", {
|
||||||
|
folder_id: folder.id,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
toast.success(t("toasts.resetSuccess"), {
|
||||||
|
description: t("toasts.resetSuccessDescription", {
|
||||||
|
branch: currentBranch,
|
||||||
|
shortHash: resetTarget.shortHash,
|
||||||
|
mode: t(`dialogs.reset.modes.${resetMode}.label`),
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
setResetTarget(null)
|
||||||
|
setResetMode("mixed")
|
||||||
|
} catch (error) {
|
||||||
|
toast.error(t("toasts.resetFailed"), {
|
||||||
|
description: error instanceof Error ? error.message : String(error),
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
setResetting(false)
|
||||||
|
}
|
||||||
|
}, [
|
||||||
|
currentBranch,
|
||||||
|
fetchLog,
|
||||||
|
folder?.path,
|
||||||
|
folder?.id,
|
||||||
|
isResetAllowed,
|
||||||
|
refreshBranches,
|
||||||
|
resetMode,
|
||||||
|
resetTarget,
|
||||||
|
resetting,
|
||||||
|
t,
|
||||||
|
])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
void fetchLog()
|
void fetchLog()
|
||||||
}, [fetchLog])
|
}, [fetchLog])
|
||||||
@@ -1210,6 +1301,20 @@ export function GitLogTab() {
|
|||||||
<GitCompare className="h-3.5 w-3.5" />
|
<GitCompare className="h-3.5 w-3.5" />
|
||||||
{tCommon("viewDiff")}
|
{tCommon("viewDiff")}
|
||||||
</ContextMenuItem>
|
</ContextMenuItem>
|
||||||
|
<ContextMenuItem
|
||||||
|
disabled={!isResetAllowed}
|
||||||
|
onSelect={() => {
|
||||||
|
handleOpenResetDialog(entry)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<RotateCcw className="size-3.5" />
|
||||||
|
{t("resetToHere")}
|
||||||
|
</ContextMenuItem>
|
||||||
|
{!isResetAllowed && (
|
||||||
|
<ContextMenuItem disabled>
|
||||||
|
{t("resetDisabledReasonNotCurrentBranchView")}
|
||||||
|
</ContextMenuItem>
|
||||||
|
)}
|
||||||
<ContextMenuItem
|
<ContextMenuItem
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
void fetchLog()
|
void fetchLog()
|
||||||
@@ -1321,6 +1426,103 @@ export function GitLogTab() {
|
|||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
open={resetTarget !== null}
|
||||||
|
onOpenChange={(open) => {
|
||||||
|
if (!open && !resetting) {
|
||||||
|
setResetTarget(null)
|
||||||
|
setResetMode("mixed")
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<DialogContent>
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>{t("dialogs.reset.title")}</DialogTitle>
|
||||||
|
</DialogHeader>
|
||||||
|
<div className="space-y-4">
|
||||||
|
<div className="grid grid-cols-[4.5rem_minmax(0,1fr)] items-start gap-x-2 gap-y-1 text-xs">
|
||||||
|
<span className="text-muted-foreground">
|
||||||
|
{t("dialogs.reset.branchLabel")}
|
||||||
|
</span>
|
||||||
|
<code className="block min-w-0 break-all font-mono">
|
||||||
|
{currentBranch ?? "-"}
|
||||||
|
</code>
|
||||||
|
<span className="text-muted-foreground">
|
||||||
|
{t("dialogs.reset.targetLabel")}
|
||||||
|
</span>
|
||||||
|
<code className="block min-w-0 break-all font-mono">
|
||||||
|
{resetTarget?.shortHash ?? "-"}
|
||||||
|
</code>
|
||||||
|
<span className="text-muted-foreground">
|
||||||
|
{t("dialogs.reset.messageLabel")}
|
||||||
|
</span>
|
||||||
|
<p className="min-w-0 whitespace-pre-wrap break-words">
|
||||||
|
{resetTarget?.message || "-"}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="space-y-2">
|
||||||
|
<p className="text-xs text-muted-foreground">
|
||||||
|
{t("dialogs.reset.modeLabel")}
|
||||||
|
</p>
|
||||||
|
<RadioGroup
|
||||||
|
value={resetMode}
|
||||||
|
onValueChange={(value) => {
|
||||||
|
setResetMode(value as GitResetMode)
|
||||||
|
}}
|
||||||
|
className="space-y-2"
|
||||||
|
disabled={resetting}
|
||||||
|
>
|
||||||
|
{(["soft", "mixed", "hard", "keep"] as const).map((mode) => {
|
||||||
|
const optionId = `git-reset-mode-${mode}`
|
||||||
|
return (
|
||||||
|
<label
|
||||||
|
key={mode}
|
||||||
|
htmlFor={optionId}
|
||||||
|
className="flex cursor-pointer items-start gap-2 rounded-md border border-border/60 p-2"
|
||||||
|
>
|
||||||
|
<RadioGroupItem
|
||||||
|
id={optionId}
|
||||||
|
value={mode}
|
||||||
|
className="mt-0.5"
|
||||||
|
/>
|
||||||
|
<div className="min-w-0">
|
||||||
|
<p className="text-sm font-medium leading-tight">
|
||||||
|
{t(`dialogs.reset.modes.${mode}.label`)}
|
||||||
|
</p>
|
||||||
|
<p className="mt-0.5 whitespace-pre-line text-xs leading-relaxed text-muted-foreground">
|
||||||
|
{t(`dialogs.reset.modes.${mode}.description`)}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</RadioGroup>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<DialogFooter>
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
disabled={resetting}
|
||||||
|
onClick={() => {
|
||||||
|
setResetTarget(null)
|
||||||
|
setResetMode("mixed")
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{tCommon("cancel")}
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
disabled={resetting || !isResetAllowed || !resetTarget}
|
||||||
|
onClick={() => {
|
||||||
|
void handleResetCurrentBranchToCommit()
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("dialogs.reset.confirmButton")}
|
||||||
|
</Button>
|
||||||
|
</DialogFooter>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1181,6 +1181,8 @@
|
|||||||
"loadingBranches": "جارٍ تحميل الفروع...",
|
"loadingBranches": "جارٍ تحميل الفروع...",
|
||||||
"noContainingBranches": "لم يتم العثور على فروع تحتوي هذا الالتزام.",
|
"noContainingBranches": "لم يتم العثور على فروع تحتوي هذا الالتزام.",
|
||||||
"newBranch": "فرع جديد...",
|
"newBranch": "فرع جديد...",
|
||||||
|
"resetToHere": "إعادة الضبط إلى هنا",
|
||||||
|
"resetDisabledReasonNotCurrentBranchView": "متاح فقط عند عرض الفرع الحالي",
|
||||||
"viewCommitDiffAria": "عرض diff للالتزام {hash}",
|
"viewCommitDiffAria": "عرض diff للالتزام {hash}",
|
||||||
"copyFullCommitHashAria": "نسخ hash الكامل للالتزام {hash}",
|
"copyFullCommitHashAria": "نسخ hash الكامل للالتزام {hash}",
|
||||||
"pushStatus": {
|
"pushStatus": {
|
||||||
@@ -1199,7 +1201,10 @@
|
|||||||
"createdAndSwitchedNewBranch": "تم إنشاء فرع جديد والتبديل إليه",
|
"createdAndSwitchedNewBranch": "تم إنشاء فرع جديد والتبديل إليه",
|
||||||
"newBranchFromCommit": "{name} (من {shortHash})",
|
"newBranchFromCommit": "{name} (من {shortHash})",
|
||||||
"createBranchFailed": "فشل إنشاء الفرع",
|
"createBranchFailed": "فشل إنشاء الفرع",
|
||||||
"openPushWindowFailed": "فشل فتح نافذة الدفع"
|
"openPushWindowFailed": "فشل فتح نافذة الدفع",
|
||||||
|
"resetSuccess": "تمت إعادة الضبط بنجاح",
|
||||||
|
"resetSuccessDescription": "تمت إعادة ضبط {branch} إلى {shortHash} باستخدام {mode}",
|
||||||
|
"resetFailed": "فشلت إعادة الضبط"
|
||||||
},
|
},
|
||||||
"branchSelector": {
|
"branchSelector": {
|
||||||
"selectBranchPlaceholder": "اختر فرعًا...",
|
"selectBranchPlaceholder": "اختر فرعًا...",
|
||||||
@@ -1211,7 +1216,33 @@
|
|||||||
"dialogs": {
|
"dialogs": {
|
||||||
"newBranchTitle": "فرع جديد",
|
"newBranchTitle": "فرع جديد",
|
||||||
"newBranchDescription": "إنشاء فرع جديد مع الالتزام {shortHash} كأحدث التزام.",
|
"newBranchDescription": "إنشاء فرع جديد مع الالتزام {shortHash} كأحدث التزام.",
|
||||||
"branchNamePlaceholder": "اسم الفرع"
|
"branchNamePlaceholder": "اسم الفرع",
|
||||||
|
"reset": {
|
||||||
|
"title": "إعادة ضبط الفرع الحالي إلى هذا الالتزام",
|
||||||
|
"branchLabel": "الفرع",
|
||||||
|
"targetLabel": "الالتزام الهدف",
|
||||||
|
"messageLabel": "الرسالة",
|
||||||
|
"modeLabel": "وضع إعادة الضبط",
|
||||||
|
"confirmButton": "إعادة الضبط",
|
||||||
|
"modes": {
|
||||||
|
"soft": {
|
||||||
|
"label": "--soft",
|
||||||
|
"description": "ينقل HEAD ومؤشر الفرع الحالي إلى الالتزام الهدف.\nيبقي Index و Working Tree بدون تغيير.\nتظل تغييرات الالتزامات التي تمت إزالتها في حالة staged."
|
||||||
|
},
|
||||||
|
"mixed": {
|
||||||
|
"label": "--mixed (الافتراضي)",
|
||||||
|
"description": "ينقل HEAD إلى الالتزام الهدف.\nيعيد ضبط Index إلى الالتزام الهدف مع الإبقاء على تغييرات Working Tree.\nتتحول التغييرات من staged إلى unstaged."
|
||||||
|
},
|
||||||
|
"hard": {
|
||||||
|
"label": "--hard",
|
||||||
|
"description": "ينقل HEAD ويعيد ضبط كل من Index و Working Tree إلى الالتزام الهدف.\nسيتم حذف التغييرات المحلية المتتبعة بعد الالتزام الهدف.\nهذه عملية تدميرية."
|
||||||
|
},
|
||||||
|
"keep": {
|
||||||
|
"label": "--keep",
|
||||||
|
"description": "ينقل HEAD إلى الالتزام الهدف مع محاولة الاحتفاظ بالتغييرات المحلية.\nيتم الاحتفاظ فقط بالتغييرات غير المتعارضة.\nعند وجود تعارض، يتم إيقاف العملية لحماية عملك."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitChangesTab": {
|
"gitChangesTab": {
|
||||||
|
|||||||
@@ -1181,6 +1181,8 @@
|
|||||||
"loadingBranches": "Branches werden geladen...",
|
"loadingBranches": "Branches werden geladen...",
|
||||||
"noContainingBranches": "Keine enthaltenen Branches gefunden.",
|
"noContainingBranches": "Keine enthaltenen Branches gefunden.",
|
||||||
"newBranch": "Neuer Branch...",
|
"newBranch": "Neuer Branch...",
|
||||||
|
"resetToHere": "Auf diesen Stand zurücksetzen",
|
||||||
|
"resetDisabledReasonNotCurrentBranchView": "Nur in der Ansicht des aktuellen Branches verfügbar",
|
||||||
"viewCommitDiffAria": "Diff für Commit {hash} anzeigen",
|
"viewCommitDiffAria": "Diff für Commit {hash} anzeigen",
|
||||||
"copyFullCommitHashAria": "Vollständigen Commit-Hash {hash} kopieren",
|
"copyFullCommitHashAria": "Vollständigen Commit-Hash {hash} kopieren",
|
||||||
"pushStatus": {
|
"pushStatus": {
|
||||||
@@ -1199,7 +1201,10 @@
|
|||||||
"createdAndSwitchedNewBranch": "Neuen Branch erstellt und gewechselt",
|
"createdAndSwitchedNewBranch": "Neuen Branch erstellt und gewechselt",
|
||||||
"newBranchFromCommit": "{name} (aus {shortHash})",
|
"newBranchFromCommit": "{name} (aus {shortHash})",
|
||||||
"createBranchFailed": "Branch konnte nicht erstellt werden",
|
"createBranchFailed": "Branch konnte nicht erstellt werden",
|
||||||
"openPushWindowFailed": "Push-Fenster konnte nicht geöffnet werden"
|
"openPushWindowFailed": "Push-Fenster konnte nicht geöffnet werden",
|
||||||
|
"resetSuccess": "Zurücksetzen erfolgreich",
|
||||||
|
"resetSuccessDescription": "{branch} wurde mit {mode} auf {shortHash} zurückgesetzt",
|
||||||
|
"resetFailed": "Zurücksetzen fehlgeschlagen"
|
||||||
},
|
},
|
||||||
"branchSelector": {
|
"branchSelector": {
|
||||||
"selectBranchPlaceholder": "Branch auswählen...",
|
"selectBranchPlaceholder": "Branch auswählen...",
|
||||||
@@ -1211,7 +1216,33 @@
|
|||||||
"dialogs": {
|
"dialogs": {
|
||||||
"newBranchTitle": "Neuer Branch",
|
"newBranchTitle": "Neuer Branch",
|
||||||
"newBranchDescription": "Erstelle einen neuen Branch mit Commit {shortHash} als letztem Commit.",
|
"newBranchDescription": "Erstelle einen neuen Branch mit Commit {shortHash} als letztem Commit.",
|
||||||
"branchNamePlaceholder": "Branch-Name"
|
"branchNamePlaceholder": "Branch-Name",
|
||||||
|
"reset": {
|
||||||
|
"title": "Aktuellen Branch auf diesen Commit zurücksetzen",
|
||||||
|
"branchLabel": "Branch",
|
||||||
|
"targetLabel": "Ziel-Commit",
|
||||||
|
"messageLabel": "Nachricht",
|
||||||
|
"modeLabel": "Reset-Modus",
|
||||||
|
"confirmButton": "Zurücksetzen",
|
||||||
|
"modes": {
|
||||||
|
"soft": {
|
||||||
|
"label": "--soft",
|
||||||
|
"description": "Verschiebt HEAD und den Zeiger des aktuellen Branches auf den Ziel-Commit.\nIndex und Working Tree bleiben unverändert.\nÄnderungen aus den entfernten Commits bleiben staged."
|
||||||
|
},
|
||||||
|
"mixed": {
|
||||||
|
"label": "--mixed (Standard)",
|
||||||
|
"description": "Verschiebt HEAD auf den Ziel-Commit.\nSetzt den Index auf den Ziel-Commit zurück und behält Änderungen im Working Tree.\nÄnderungen wechseln von staged zu unstaged."
|
||||||
|
},
|
||||||
|
"hard": {
|
||||||
|
"label": "--hard",
|
||||||
|
"description": "Verschiebt HEAD und setzt sowohl Index als auch Working Tree auf den Ziel-Commit zurück.\nLokale verfolgte Änderungen nach dem Ziel-Commit werden verworfen.\nDies ist eine destruktive Operation."
|
||||||
|
},
|
||||||
|
"keep": {
|
||||||
|
"label": "--keep",
|
||||||
|
"description": "Verschiebt HEAD auf den Ziel-Commit und versucht lokale Änderungen zu behalten.\nNur nicht-konfliktierende Änderungen bleiben erhalten.\nBei Konflikten wird der Reset zum Schutz der Änderungen abgebrochen."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitChangesTab": {
|
"gitChangesTab": {
|
||||||
|
|||||||
@@ -1181,6 +1181,8 @@
|
|||||||
"loadingBranches": "Loading branches...",
|
"loadingBranches": "Loading branches...",
|
||||||
"noContainingBranches": "No containing branches found.",
|
"noContainingBranches": "No containing branches found.",
|
||||||
"newBranch": "New branch...",
|
"newBranch": "New branch...",
|
||||||
|
"resetToHere": "Reset to Here",
|
||||||
|
"resetDisabledReasonNotCurrentBranchView": "Available only when viewing current branch",
|
||||||
"viewCommitDiffAria": "View diff for commit {hash}",
|
"viewCommitDiffAria": "View diff for commit {hash}",
|
||||||
"copyFullCommitHashAria": "Copy full commit hash {hash}",
|
"copyFullCommitHashAria": "Copy full commit hash {hash}",
|
||||||
"pushStatus": {
|
"pushStatus": {
|
||||||
@@ -1199,7 +1201,10 @@
|
|||||||
"createdAndSwitchedNewBranch": "Created and switched to new branch",
|
"createdAndSwitchedNewBranch": "Created and switched to new branch",
|
||||||
"newBranchFromCommit": "{name} (from {shortHash})",
|
"newBranchFromCommit": "{name} (from {shortHash})",
|
||||||
"createBranchFailed": "Failed to create branch",
|
"createBranchFailed": "Failed to create branch",
|
||||||
"openPushWindowFailed": "Failed to open push window"
|
"openPushWindowFailed": "Failed to open push window",
|
||||||
|
"resetSuccess": "Reset successful",
|
||||||
|
"resetSuccessDescription": "{branch} reset to {shortHash} with {mode}",
|
||||||
|
"resetFailed": "Reset failed"
|
||||||
},
|
},
|
||||||
"branchSelector": {
|
"branchSelector": {
|
||||||
"selectBranchPlaceholder": "Select branch...",
|
"selectBranchPlaceholder": "Select branch...",
|
||||||
@@ -1211,7 +1216,33 @@
|
|||||||
"dialogs": {
|
"dialogs": {
|
||||||
"newBranchTitle": "New branch",
|
"newBranchTitle": "New branch",
|
||||||
"newBranchDescription": "Create a new branch with commit {shortHash} as the latest commit.",
|
"newBranchDescription": "Create a new branch with commit {shortHash} as the latest commit.",
|
||||||
"branchNamePlaceholder": "Branch name"
|
"branchNamePlaceholder": "Branch name",
|
||||||
|
"reset": {
|
||||||
|
"title": "Reset Current Branch to Here",
|
||||||
|
"branchLabel": "Branch",
|
||||||
|
"targetLabel": "Target",
|
||||||
|
"messageLabel": "Message",
|
||||||
|
"modeLabel": "Reset mode",
|
||||||
|
"confirmButton": "Reset",
|
||||||
|
"modes": {
|
||||||
|
"soft": {
|
||||||
|
"label": "--soft",
|
||||||
|
"description": "Move HEAD and the current branch pointer to the target commit.\nKeep Index and Working Tree unchanged.\nChanges from the removed commits stay staged."
|
||||||
|
},
|
||||||
|
"mixed": {
|
||||||
|
"label": "--mixed (default)",
|
||||||
|
"description": "Move HEAD to the target commit.\nReset Index to the target commit while keeping Working Tree changes.\nThose changes become unstaged."
|
||||||
|
},
|
||||||
|
"hard": {
|
||||||
|
"label": "--hard",
|
||||||
|
"description": "Move HEAD and reset both Index and Working Tree to the target commit.\nLocal tracked changes after the target commit are discarded.\nThis is a destructive operation."
|
||||||
|
},
|
||||||
|
"keep": {
|
||||||
|
"label": "--keep",
|
||||||
|
"description": "Move HEAD to the target commit and keep local changes when possible.\nOnly non-conflicting local changes are preserved.\nIf conflicts are detected, reset aborts to protect your work."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitChangesTab": {
|
"gitChangesTab": {
|
||||||
|
|||||||
@@ -1181,6 +1181,8 @@
|
|||||||
"loadingBranches": "Cargando ramas...",
|
"loadingBranches": "Cargando ramas...",
|
||||||
"noContainingBranches": "No se encontraron ramas contenedoras.",
|
"noContainingBranches": "No se encontraron ramas contenedoras.",
|
||||||
"newBranch": "Nueva rama...",
|
"newBranch": "Nueva rama...",
|
||||||
|
"resetToHere": "Resetear aquí",
|
||||||
|
"resetDisabledReasonNotCurrentBranchView": "Disponible solo al ver la rama actual",
|
||||||
"viewCommitDiffAria": "Ver diff del commit {hash}",
|
"viewCommitDiffAria": "Ver diff del commit {hash}",
|
||||||
"copyFullCommitHashAria": "Copiar hash completo del commit {hash}",
|
"copyFullCommitHashAria": "Copiar hash completo del commit {hash}",
|
||||||
"pushStatus": {
|
"pushStatus": {
|
||||||
@@ -1199,7 +1201,10 @@
|
|||||||
"createdAndSwitchedNewBranch": "Nueva rama creada y activada",
|
"createdAndSwitchedNewBranch": "Nueva rama creada y activada",
|
||||||
"newBranchFromCommit": "{name} (desde {shortHash})",
|
"newBranchFromCommit": "{name} (desde {shortHash})",
|
||||||
"createBranchFailed": "No se pudo crear la rama",
|
"createBranchFailed": "No se pudo crear la rama",
|
||||||
"openPushWindowFailed": "No se pudo abrir la ventana de envío"
|
"openPushWindowFailed": "No se pudo abrir la ventana de envío",
|
||||||
|
"resetSuccess": "Reset completado",
|
||||||
|
"resetSuccessDescription": "{branch} se reseteó a {shortHash} con {mode}",
|
||||||
|
"resetFailed": "Falló el reset"
|
||||||
},
|
},
|
||||||
"branchSelector": {
|
"branchSelector": {
|
||||||
"selectBranchPlaceholder": "Seleccionar rama...",
|
"selectBranchPlaceholder": "Seleccionar rama...",
|
||||||
@@ -1211,7 +1216,33 @@
|
|||||||
"dialogs": {
|
"dialogs": {
|
||||||
"newBranchTitle": "Nueva rama",
|
"newBranchTitle": "Nueva rama",
|
||||||
"newBranchDescription": "Crea una nueva rama con el commit {shortHash} como último commit.",
|
"newBranchDescription": "Crea una nueva rama con el commit {shortHash} como último commit.",
|
||||||
"branchNamePlaceholder": "Nombre de la rama"
|
"branchNamePlaceholder": "Nombre de la rama",
|
||||||
|
"reset": {
|
||||||
|
"title": "Resetear la rama actual hasta aquí",
|
||||||
|
"branchLabel": "Rama",
|
||||||
|
"targetLabel": "Commit objetivo",
|
||||||
|
"messageLabel": "Mensaje",
|
||||||
|
"modeLabel": "Modo de reset",
|
||||||
|
"confirmButton": "Resetear",
|
||||||
|
"modes": {
|
||||||
|
"soft": {
|
||||||
|
"label": "--soft",
|
||||||
|
"description": "Mueve HEAD y el puntero de la rama actual al commit objetivo.\nMantiene Index y Working Tree sin cambios.\nLos cambios de los commits retirados permanecen en estado staged."
|
||||||
|
},
|
||||||
|
"mixed": {
|
||||||
|
"label": "--mixed (predeterminado)",
|
||||||
|
"description": "Mueve HEAD al commit objetivo.\nResetea Index al commit objetivo y mantiene los cambios en Working Tree.\nLos cambios pasan de staged a unstaged."
|
||||||
|
},
|
||||||
|
"hard": {
|
||||||
|
"label": "--hard",
|
||||||
|
"description": "Mueve HEAD y resetea tanto Index como Working Tree al commit objetivo.\nSe descartan los cambios locales rastreados posteriores al commit objetivo.\nEs una operación destructiva."
|
||||||
|
},
|
||||||
|
"keep": {
|
||||||
|
"label": "--keep",
|
||||||
|
"description": "Mueve HEAD al commit objetivo e intenta conservar los cambios locales.\nSolo se conservan cambios que no entren en conflicto.\nSi hay conflictos, el reset se aborta para proteger tu trabajo."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitChangesTab": {
|
"gitChangesTab": {
|
||||||
|
|||||||
@@ -1181,6 +1181,8 @@
|
|||||||
"loadingBranches": "Chargement des branches...",
|
"loadingBranches": "Chargement des branches...",
|
||||||
"noContainingBranches": "Aucune branche contenant ce commit.",
|
"noContainingBranches": "Aucune branche contenant ce commit.",
|
||||||
"newBranch": "Nouvelle branche...",
|
"newBranch": "Nouvelle branche...",
|
||||||
|
"resetToHere": "Réinitialiser ici",
|
||||||
|
"resetDisabledReasonNotCurrentBranchView": "Disponible uniquement en affichant la branche actuelle",
|
||||||
"viewCommitDiffAria": "Voir le diff du commit {hash}",
|
"viewCommitDiffAria": "Voir le diff du commit {hash}",
|
||||||
"copyFullCommitHashAria": "Copier le hash complet du commit {hash}",
|
"copyFullCommitHashAria": "Copier le hash complet du commit {hash}",
|
||||||
"pushStatus": {
|
"pushStatus": {
|
||||||
@@ -1199,7 +1201,10 @@
|
|||||||
"createdAndSwitchedNewBranch": "Nouvelle branche créée et activée",
|
"createdAndSwitchedNewBranch": "Nouvelle branche créée et activée",
|
||||||
"newBranchFromCommit": "{name} (depuis {shortHash})",
|
"newBranchFromCommit": "{name} (depuis {shortHash})",
|
||||||
"createBranchFailed": "Échec de la création de la branche",
|
"createBranchFailed": "Échec de la création de la branche",
|
||||||
"openPushWindowFailed": "Échec de l'ouverture de la fenêtre de push"
|
"openPushWindowFailed": "Échec de l'ouverture de la fenêtre de push",
|
||||||
|
"resetSuccess": "Réinitialisation réussie",
|
||||||
|
"resetSuccessDescription": "{branch} a été réinitialisée sur {shortHash} avec {mode}",
|
||||||
|
"resetFailed": "Échec de la réinitialisation"
|
||||||
},
|
},
|
||||||
"branchSelector": {
|
"branchSelector": {
|
||||||
"selectBranchPlaceholder": "Sélectionner une branche...",
|
"selectBranchPlaceholder": "Sélectionner une branche...",
|
||||||
@@ -1211,7 +1216,33 @@
|
|||||||
"dialogs": {
|
"dialogs": {
|
||||||
"newBranchTitle": "Nouvelle branche",
|
"newBranchTitle": "Nouvelle branche",
|
||||||
"newBranchDescription": "Créer une nouvelle branche avec le commit {shortHash} comme dernier commit.",
|
"newBranchDescription": "Créer une nouvelle branche avec le commit {shortHash} comme dernier commit.",
|
||||||
"branchNamePlaceholder": "Nom de la branche"
|
"branchNamePlaceholder": "Nom de la branche",
|
||||||
|
"reset": {
|
||||||
|
"title": "Réinitialiser la branche actuelle jusqu’ici",
|
||||||
|
"branchLabel": "Branche",
|
||||||
|
"targetLabel": "Commit cible",
|
||||||
|
"messageLabel": "Message",
|
||||||
|
"modeLabel": "Mode de réinitialisation",
|
||||||
|
"confirmButton": "Réinitialiser",
|
||||||
|
"modes": {
|
||||||
|
"soft": {
|
||||||
|
"label": "--soft",
|
||||||
|
"description": "Déplace HEAD et le pointeur de la branche actuelle vers le commit cible.\nConserve Index et Working Tree inchangés.\nLes changements des commits retirés restent staged."
|
||||||
|
},
|
||||||
|
"mixed": {
|
||||||
|
"label": "--mixed (par défaut)",
|
||||||
|
"description": "Déplace HEAD vers le commit cible.\nRéinitialise Index au commit cible tout en conservant les changements du Working Tree.\nLes changements passent de staged à unstaged."
|
||||||
|
},
|
||||||
|
"hard": {
|
||||||
|
"label": "--hard",
|
||||||
|
"description": "Déplace HEAD et réinitialise à la fois Index et Working Tree au commit cible.\nLes changements locaux suivis après le commit cible sont supprimés.\nC’est une opération destructive."
|
||||||
|
},
|
||||||
|
"keep": {
|
||||||
|
"label": "--keep",
|
||||||
|
"description": "Déplace HEAD vers le commit cible en conservant les changements locaux quand c’est possible.\nSeuls les changements sans conflit sont conservés.\nEn cas de conflit, la réinitialisation est annulée pour protéger votre travail."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitChangesTab": {
|
"gitChangesTab": {
|
||||||
|
|||||||
@@ -1181,6 +1181,8 @@
|
|||||||
"loadingBranches": "ブランチを読み込み中...",
|
"loadingBranches": "ブランチを読み込み中...",
|
||||||
"noContainingBranches": "含まれるブランチが見つかりません。",
|
"noContainingBranches": "含まれるブランチが見つかりません。",
|
||||||
"newBranch": "新規ブランチ...",
|
"newBranch": "新規ブランチ...",
|
||||||
|
"resetToHere": "ここにリセット",
|
||||||
|
"resetDisabledReasonNotCurrentBranchView": "現在のブランチ表示時のみ利用できます",
|
||||||
"viewCommitDiffAria": "コミット {hash} の差分を表示",
|
"viewCommitDiffAria": "コミット {hash} の差分を表示",
|
||||||
"copyFullCommitHashAria": "完全なコミットハッシュ {hash} をコピー",
|
"copyFullCommitHashAria": "完全なコミットハッシュ {hash} をコピー",
|
||||||
"pushStatus": {
|
"pushStatus": {
|
||||||
@@ -1199,7 +1201,10 @@
|
|||||||
"createdAndSwitchedNewBranch": "新しいブランチを作成して切り替えました",
|
"createdAndSwitchedNewBranch": "新しいブランチを作成して切り替えました",
|
||||||
"newBranchFromCommit": "{name}({shortHash} から)",
|
"newBranchFromCommit": "{name}({shortHash} から)",
|
||||||
"createBranchFailed": "ブランチ作成に失敗しました",
|
"createBranchFailed": "ブランチ作成に失敗しました",
|
||||||
"openPushWindowFailed": "プッシュウィンドウを開けませんでした"
|
"openPushWindowFailed": "プッシュウィンドウを開けませんでした",
|
||||||
|
"resetSuccess": "リセットが完了しました",
|
||||||
|
"resetSuccessDescription": "{branch} を {mode} で {shortHash} にリセットしました",
|
||||||
|
"resetFailed": "リセットに失敗しました"
|
||||||
},
|
},
|
||||||
"branchSelector": {
|
"branchSelector": {
|
||||||
"selectBranchPlaceholder": "ブランチを選択...",
|
"selectBranchPlaceholder": "ブランチを選択...",
|
||||||
@@ -1211,7 +1216,33 @@
|
|||||||
"dialogs": {
|
"dialogs": {
|
||||||
"newBranchTitle": "新規ブランチ",
|
"newBranchTitle": "新規ブランチ",
|
||||||
"newBranchDescription": "コミット {shortHash} を最新コミットとして新しいブランチを作成します。",
|
"newBranchDescription": "コミット {shortHash} を最新コミットとして新しいブランチを作成します。",
|
||||||
"branchNamePlaceholder": "ブランチ名"
|
"branchNamePlaceholder": "ブランチ名",
|
||||||
|
"reset": {
|
||||||
|
"title": "現在のブランチをこのコミットへリセット",
|
||||||
|
"branchLabel": "ブランチ",
|
||||||
|
"targetLabel": "対象コミット",
|
||||||
|
"messageLabel": "コミットメッセージ",
|
||||||
|
"modeLabel": "リセットモード",
|
||||||
|
"confirmButton": "リセット",
|
||||||
|
"modes": {
|
||||||
|
"soft": {
|
||||||
|
"label": "--soft",
|
||||||
|
"description": "HEAD と現在のブランチ参照を対象コミットへ移動します。\nIndex と Working Tree は変更しません。\n取り消されたコミットの変更は staged のまま残ります。"
|
||||||
|
},
|
||||||
|
"mixed": {
|
||||||
|
"label": "--mixed(デフォルト)",
|
||||||
|
"description": "HEAD を対象コミットへ移動します。\nIndex を対象コミットに戻し、Working Tree の変更は維持します。\n変更は staged から unstaged に戻ります。"
|
||||||
|
},
|
||||||
|
"hard": {
|
||||||
|
"label": "--hard",
|
||||||
|
"description": "HEAD を移動し、Index と Working Tree を対象コミットに戻します。\n対象コミット以降の追跡中ローカル変更は破棄されます。\n破壊的な操作です。"
|
||||||
|
},
|
||||||
|
"keep": {
|
||||||
|
"label": "--keep",
|
||||||
|
"description": "HEAD を対象コミットへ移動し、可能な限りローカル変更を保持します。\n競合しない変更のみ保持されます。\n競合がある場合は保護のため処理を中止します。"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitChangesTab": {
|
"gitChangesTab": {
|
||||||
|
|||||||
@@ -1181,6 +1181,8 @@
|
|||||||
"loadingBranches": "브랜치 로딩 중...",
|
"loadingBranches": "브랜치 로딩 중...",
|
||||||
"noContainingBranches": "포함하는 브랜치를 찾을 수 없습니다.",
|
"noContainingBranches": "포함하는 브랜치를 찾을 수 없습니다.",
|
||||||
"newBranch": "새 브랜치...",
|
"newBranch": "새 브랜치...",
|
||||||
|
"resetToHere": "여기로 리셋",
|
||||||
|
"resetDisabledReasonNotCurrentBranchView": "현재 브랜치 보기에서만 사용할 수 있습니다",
|
||||||
"viewCommitDiffAria": "커밋 {hash}의 diff 보기",
|
"viewCommitDiffAria": "커밋 {hash}의 diff 보기",
|
||||||
"copyFullCommitHashAria": "전체 커밋 해시 {hash} 복사",
|
"copyFullCommitHashAria": "전체 커밋 해시 {hash} 복사",
|
||||||
"pushStatus": {
|
"pushStatus": {
|
||||||
@@ -1199,7 +1201,10 @@
|
|||||||
"createdAndSwitchedNewBranch": "새 브랜치를 생성하고 전환했습니다",
|
"createdAndSwitchedNewBranch": "새 브랜치를 생성하고 전환했습니다",
|
||||||
"newBranchFromCommit": "{name} ({shortHash}에서 생성)",
|
"newBranchFromCommit": "{name} ({shortHash}에서 생성)",
|
||||||
"createBranchFailed": "브랜치 생성에 실패했습니다",
|
"createBranchFailed": "브랜치 생성에 실패했습니다",
|
||||||
"openPushWindowFailed": "푸시 창을 열지 못했습니다"
|
"openPushWindowFailed": "푸시 창을 열지 못했습니다",
|
||||||
|
"resetSuccess": "리셋 완료",
|
||||||
|
"resetSuccessDescription": "{branch}을(를) {mode}로 {shortHash}에 리셋했습니다",
|
||||||
|
"resetFailed": "리셋 실패"
|
||||||
},
|
},
|
||||||
"branchSelector": {
|
"branchSelector": {
|
||||||
"selectBranchPlaceholder": "브랜치 선택...",
|
"selectBranchPlaceholder": "브랜치 선택...",
|
||||||
@@ -1211,7 +1216,33 @@
|
|||||||
"dialogs": {
|
"dialogs": {
|
||||||
"newBranchTitle": "새 브랜치",
|
"newBranchTitle": "새 브랜치",
|
||||||
"newBranchDescription": "커밋 {shortHash}를 최신 커밋으로 하여 새 브랜치를 생성합니다.",
|
"newBranchDescription": "커밋 {shortHash}를 최신 커밋으로 하여 새 브랜치를 생성합니다.",
|
||||||
"branchNamePlaceholder": "브랜치 이름"
|
"branchNamePlaceholder": "브랜치 이름",
|
||||||
|
"reset": {
|
||||||
|
"title": "현재 브랜치를 이 커밋으로 리셋",
|
||||||
|
"branchLabel": "브랜치",
|
||||||
|
"targetLabel": "대상 커밋",
|
||||||
|
"messageLabel": "커밋 메시지",
|
||||||
|
"modeLabel": "리셋 모드",
|
||||||
|
"confirmButton": "리셋",
|
||||||
|
"modes": {
|
||||||
|
"soft": {
|
||||||
|
"label": "--soft",
|
||||||
|
"description": "HEAD와 현재 브랜치 포인터를 대상 커밋으로 이동합니다.\nIndex와 Working Tree는 변경하지 않습니다.\n되돌려진 커밋의 변경 사항은 staged 상태로 유지됩니다."
|
||||||
|
},
|
||||||
|
"mixed": {
|
||||||
|
"label": "--mixed (기본값)",
|
||||||
|
"description": "HEAD를 대상 커밋으로 이동합니다.\nIndex를 대상 커밋으로 되돌리고 Working Tree 변경은 유지합니다.\n변경 사항은 staged에서 unstaged로 바뀝니다."
|
||||||
|
},
|
||||||
|
"hard": {
|
||||||
|
"label": "--hard",
|
||||||
|
"description": "HEAD를 이동하고 Index와 Working Tree를 모두 대상 커밋으로 되돌립니다.\n대상 커밋 이후의 추적된 로컬 변경은 삭제됩니다.\n파괴적인 작업입니다."
|
||||||
|
},
|
||||||
|
"keep": {
|
||||||
|
"label": "--keep",
|
||||||
|
"description": "HEAD를 대상 커밋으로 이동하면서 가능한 한 로컬 변경을 유지합니다.\n충돌하지 않는 변경만 보존됩니다.\n충돌이 감지되면 작업 보호를 위해 리셋이 중단됩니다."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitChangesTab": {
|
"gitChangesTab": {
|
||||||
|
|||||||
@@ -1181,6 +1181,8 @@
|
|||||||
"loadingBranches": "Carregando branches...",
|
"loadingBranches": "Carregando branches...",
|
||||||
"noContainingBranches": "Nenhuma branch contendo este commit foi encontrada.",
|
"noContainingBranches": "Nenhuma branch contendo este commit foi encontrada.",
|
||||||
"newBranch": "Nova branch...",
|
"newBranch": "Nova branch...",
|
||||||
|
"resetToHere": "Resetar para aqui",
|
||||||
|
"resetDisabledReasonNotCurrentBranchView": "Disponível somente ao visualizar a branch atual",
|
||||||
"viewCommitDiffAria": "Ver diff do commit {hash}",
|
"viewCommitDiffAria": "Ver diff do commit {hash}",
|
||||||
"copyFullCommitHashAria": "Copiar hash completo do commit {hash}",
|
"copyFullCommitHashAria": "Copiar hash completo do commit {hash}",
|
||||||
"pushStatus": {
|
"pushStatus": {
|
||||||
@@ -1199,7 +1201,10 @@
|
|||||||
"createdAndSwitchedNewBranch": "Nova branch criada e selecionada",
|
"createdAndSwitchedNewBranch": "Nova branch criada e selecionada",
|
||||||
"newBranchFromCommit": "{name} (de {shortHash})",
|
"newBranchFromCommit": "{name} (de {shortHash})",
|
||||||
"createBranchFailed": "Falha ao criar branch",
|
"createBranchFailed": "Falha ao criar branch",
|
||||||
"openPushWindowFailed": "Falha ao abrir a janela de push"
|
"openPushWindowFailed": "Falha ao abrir a janela de push",
|
||||||
|
"resetSuccess": "Reset concluído",
|
||||||
|
"resetSuccessDescription": "{branch} foi resetada para {shortHash} com {mode}",
|
||||||
|
"resetFailed": "Falha no reset"
|
||||||
},
|
},
|
||||||
"branchSelector": {
|
"branchSelector": {
|
||||||
"selectBranchPlaceholder": "Selecionar branch...",
|
"selectBranchPlaceholder": "Selecionar branch...",
|
||||||
@@ -1211,7 +1216,33 @@
|
|||||||
"dialogs": {
|
"dialogs": {
|
||||||
"newBranchTitle": "Nova branch",
|
"newBranchTitle": "Nova branch",
|
||||||
"newBranchDescription": "Criar uma nova branch com o commit {shortHash} como commit mais recente.",
|
"newBranchDescription": "Criar uma nova branch com o commit {shortHash} como commit mais recente.",
|
||||||
"branchNamePlaceholder": "Nome da branch"
|
"branchNamePlaceholder": "Nome da branch",
|
||||||
|
"reset": {
|
||||||
|
"title": "Resetar a branch atual para este commit",
|
||||||
|
"branchLabel": "Branch",
|
||||||
|
"targetLabel": "Commit alvo",
|
||||||
|
"messageLabel": "Mensagem",
|
||||||
|
"modeLabel": "Modo de reset",
|
||||||
|
"confirmButton": "Resetar",
|
||||||
|
"modes": {
|
||||||
|
"soft": {
|
||||||
|
"label": "--soft",
|
||||||
|
"description": "Move o HEAD e o ponteiro da branch atual para o commit alvo.\nMantém Index e Working Tree sem alterações.\nAs mudanças dos commits removidos permanecem staged."
|
||||||
|
},
|
||||||
|
"mixed": {
|
||||||
|
"label": "--mixed (padrão)",
|
||||||
|
"description": "Move o HEAD para o commit alvo.\nReseta o Index para o commit alvo e mantém as mudanças no Working Tree.\nAs mudanças passam de staged para unstaged."
|
||||||
|
},
|
||||||
|
"hard": {
|
||||||
|
"label": "--hard",
|
||||||
|
"description": "Move o HEAD e reseta tanto Index quanto Working Tree para o commit alvo.\nAs mudanças locais rastreadas após o commit alvo são descartadas.\nEsta é uma operação destrutiva."
|
||||||
|
},
|
||||||
|
"keep": {
|
||||||
|
"label": "--keep",
|
||||||
|
"description": "Move o HEAD para o commit alvo e tenta preservar alterações locais.\nSomente alterações sem conflito são mantidas.\nSe houver conflito, o reset é abortado para proteger seu trabalho."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitChangesTab": {
|
"gitChangesTab": {
|
||||||
|
|||||||
@@ -1181,6 +1181,8 @@
|
|||||||
"loadingBranches": "正在加载分支...",
|
"loadingBranches": "正在加载分支...",
|
||||||
"noContainingBranches": "未找到包含此提交的分支。",
|
"noContainingBranches": "未找到包含此提交的分支。",
|
||||||
"newBranch": "新建分支...",
|
"newBranch": "新建分支...",
|
||||||
|
"resetToHere": "重置到此处",
|
||||||
|
"resetDisabledReasonNotCurrentBranchView": "仅在查看当前分支时可用",
|
||||||
"viewCommitDiffAria": "查看提交 {hash} 的差异",
|
"viewCommitDiffAria": "查看提交 {hash} 的差异",
|
||||||
"copyFullCommitHashAria": "复制完整提交哈希 {hash}",
|
"copyFullCommitHashAria": "复制完整提交哈希 {hash}",
|
||||||
"pushStatus": {
|
"pushStatus": {
|
||||||
@@ -1199,7 +1201,10 @@
|
|||||||
"createdAndSwitchedNewBranch": "已创建并切换到新分支",
|
"createdAndSwitchedNewBranch": "已创建并切换到新分支",
|
||||||
"newBranchFromCommit": "{name}(来自 {shortHash})",
|
"newBranchFromCommit": "{name}(来自 {shortHash})",
|
||||||
"createBranchFailed": "新建分支失败",
|
"createBranchFailed": "新建分支失败",
|
||||||
"openPushWindowFailed": "打开推送窗口失败"
|
"openPushWindowFailed": "打开推送窗口失败",
|
||||||
|
"resetSuccess": "重置成功",
|
||||||
|
"resetSuccessDescription": "已将 {branch} 以 {mode} 重置到 {shortHash}",
|
||||||
|
"resetFailed": "重置失败"
|
||||||
},
|
},
|
||||||
"branchSelector": {
|
"branchSelector": {
|
||||||
"selectBranchPlaceholder": "选择分支...",
|
"selectBranchPlaceholder": "选择分支...",
|
||||||
@@ -1211,7 +1216,33 @@
|
|||||||
"dialogs": {
|
"dialogs": {
|
||||||
"newBranchTitle": "新建分支",
|
"newBranchTitle": "新建分支",
|
||||||
"newBranchDescription": "以提交 {shortHash} 作为最后提交创建新分支。",
|
"newBranchDescription": "以提交 {shortHash} 作为最后提交创建新分支。",
|
||||||
"branchNamePlaceholder": "分支名称"
|
"branchNamePlaceholder": "分支名称",
|
||||||
|
"reset": {
|
||||||
|
"title": "将当前分支重置到此提交",
|
||||||
|
"branchLabel": "分支",
|
||||||
|
"targetLabel": "目标提交",
|
||||||
|
"messageLabel": "提交信息",
|
||||||
|
"modeLabel": "重置模式",
|
||||||
|
"confirmButton": "重置",
|
||||||
|
"modes": {
|
||||||
|
"soft": {
|
||||||
|
"label": "--soft",
|
||||||
|
"description": "将 HEAD 和当前分支指针移动到目标提交。\n暂存区(Index)和工作区(Working Tree)保持不变。\n被回退提交对应的改动会保留为“已暂存”状态。"
|
||||||
|
},
|
||||||
|
"mixed": {
|
||||||
|
"label": "--mixed(默认)",
|
||||||
|
"description": "将 HEAD 移动到目标提交。\n把暂存区重置为目标提交状态,但保留工作区改动。\n这些改动会从“已暂存”变为“未暂存”。"
|
||||||
|
},
|
||||||
|
"hard": {
|
||||||
|
"label": "--hard",
|
||||||
|
"description": "将 HEAD、暂存区和工作区全部重置到目标提交。\n目标提交之后的本地已跟踪改动会被直接丢弃。\n这是破坏性操作。"
|
||||||
|
},
|
||||||
|
"keep": {
|
||||||
|
"label": "--keep",
|
||||||
|
"description": "将 HEAD 移动到目标提交,并尽量保留本地改动。\n仅当本地改动与目标提交不冲突时才会保留。\n若存在冲突,操作会中止以避免覆盖你的修改。"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitChangesTab": {
|
"gitChangesTab": {
|
||||||
|
|||||||
@@ -1181,6 +1181,8 @@
|
|||||||
"loadingBranches": "正在載入分支...",
|
"loadingBranches": "正在載入分支...",
|
||||||
"noContainingBranches": "未找到包含此提交的分支。",
|
"noContainingBranches": "未找到包含此提交的分支。",
|
||||||
"newBranch": "新增分支...",
|
"newBranch": "新增分支...",
|
||||||
|
"resetToHere": "重設到此處",
|
||||||
|
"resetDisabledReasonNotCurrentBranchView": "僅在檢視目前分支時可用",
|
||||||
"viewCommitDiffAria": "查看提交 {hash} 的差異",
|
"viewCommitDiffAria": "查看提交 {hash} 的差異",
|
||||||
"copyFullCommitHashAria": "複製完整提交雜湊 {hash}",
|
"copyFullCommitHashAria": "複製完整提交雜湊 {hash}",
|
||||||
"pushStatus": {
|
"pushStatus": {
|
||||||
@@ -1199,7 +1201,10 @@
|
|||||||
"createdAndSwitchedNewBranch": "已建立並切換到新分支",
|
"createdAndSwitchedNewBranch": "已建立並切換到新分支",
|
||||||
"newBranchFromCommit": "{name}(來自 {shortHash})",
|
"newBranchFromCommit": "{name}(來自 {shortHash})",
|
||||||
"createBranchFailed": "新增分支失敗",
|
"createBranchFailed": "新增分支失敗",
|
||||||
"openPushWindowFailed": "開啟推送視窗失敗"
|
"openPushWindowFailed": "開啟推送視窗失敗",
|
||||||
|
"resetSuccess": "重設成功",
|
||||||
|
"resetSuccessDescription": "已將 {branch} 以 {mode} 重設到 {shortHash}",
|
||||||
|
"resetFailed": "重設失敗"
|
||||||
},
|
},
|
||||||
"branchSelector": {
|
"branchSelector": {
|
||||||
"selectBranchPlaceholder": "選擇分支...",
|
"selectBranchPlaceholder": "選擇分支...",
|
||||||
@@ -1211,7 +1216,33 @@
|
|||||||
"dialogs": {
|
"dialogs": {
|
||||||
"newBranchTitle": "新增分支",
|
"newBranchTitle": "新增分支",
|
||||||
"newBranchDescription": "以提交 {shortHash} 作為最後提交建立新分支。",
|
"newBranchDescription": "以提交 {shortHash} 作為最後提交建立新分支。",
|
||||||
"branchNamePlaceholder": "分支名稱"
|
"branchNamePlaceholder": "分支名稱",
|
||||||
|
"reset": {
|
||||||
|
"title": "將目前分支重設到此提交",
|
||||||
|
"branchLabel": "分支",
|
||||||
|
"targetLabel": "目標提交",
|
||||||
|
"messageLabel": "提交訊息",
|
||||||
|
"modeLabel": "重設模式",
|
||||||
|
"confirmButton": "重設",
|
||||||
|
"modes": {
|
||||||
|
"soft": {
|
||||||
|
"label": "--soft",
|
||||||
|
"description": "將 HEAD 與目前分支指標移動到目標提交。\n暫存區(Index)與工作區(Working Tree)保持不變。\n被回退提交的變更會保留為「已暫存」。"
|
||||||
|
},
|
||||||
|
"mixed": {
|
||||||
|
"label": "--mixed(預設)",
|
||||||
|
"description": "將 HEAD 移動到目標提交。\n把暫存區重設為目標提交狀態,但保留工作區變更。\n這些變更會由「已暫存」變成「未暫存」。"
|
||||||
|
},
|
||||||
|
"hard": {
|
||||||
|
"label": "--hard",
|
||||||
|
"description": "將 HEAD、暫存區與工作區全部重設到目標提交。\n目標提交之後的本地已追蹤變更會被直接捨棄。\n這是破壞性操作。"
|
||||||
|
},
|
||||||
|
"keep": {
|
||||||
|
"label": "--keep",
|
||||||
|
"description": "將 HEAD 移動到目標提交,並盡可能保留本地變更。\n僅保留與目標提交不衝突的本地變更。\n若檢測到衝突,操作會中止以保護你的修改。"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitChangesTab": {
|
"gitChangesTab": {
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import type {
|
|||||||
GitPushInfo,
|
GitPushInfo,
|
||||||
GitMergeResult,
|
GitMergeResult,
|
||||||
GitRebaseResult,
|
GitRebaseResult,
|
||||||
|
GitResetMode,
|
||||||
GitConflictFileVersions,
|
GitConflictFileVersions,
|
||||||
GitCommitResult,
|
GitCommitResult,
|
||||||
GitRemote,
|
GitRemote,
|
||||||
@@ -1394,6 +1395,14 @@ export async function gitCommitBranches(
|
|||||||
return getTransport().call("git_commit_branches", { path, commit })
|
return getTransport().call("git_commit_branches", { path, commit })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function gitReset(
|
||||||
|
path: string,
|
||||||
|
commit: string,
|
||||||
|
mode: GitResetMode
|
||||||
|
): Promise<void> {
|
||||||
|
return getTransport().call("git_reset", { path, commit, mode })
|
||||||
|
}
|
||||||
|
|
||||||
// Terminal commands
|
// Terminal commands
|
||||||
|
|
||||||
export async function terminalSpawn(
|
export async function terminalSpawn(
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import type {
|
|||||||
GitPushInfo,
|
GitPushInfo,
|
||||||
GitMergeResult,
|
GitMergeResult,
|
||||||
GitRebaseResult,
|
GitRebaseResult,
|
||||||
|
GitResetMode,
|
||||||
GitConflictFileVersions,
|
GitConflictFileVersions,
|
||||||
GitCommitResult,
|
GitCommitResult,
|
||||||
GitRemote,
|
GitRemote,
|
||||||
@@ -1125,6 +1126,14 @@ export async function gitCommitBranches(
|
|||||||
return invoke("git_commit_branches", { path, commit })
|
return invoke("git_commit_branches", { path, commit })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function gitReset(
|
||||||
|
path: string,
|
||||||
|
commit: string,
|
||||||
|
mode: GitResetMode
|
||||||
|
): Promise<void> {
|
||||||
|
return invoke("git_reset", { path, commit, mode })
|
||||||
|
}
|
||||||
|
|
||||||
// Terminal commands
|
// Terminal commands
|
||||||
|
|
||||||
export async function terminalSpawn(
|
export async function terminalSpawn(
|
||||||
|
|||||||
@@ -736,6 +736,8 @@ export interface GitStatusEntry {
|
|||||||
file: string
|
file: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type GitResetMode = "soft" | "mixed" | "hard" | "keep"
|
||||||
|
|
||||||
export interface GitBranchList {
|
export interface GitBranchList {
|
||||||
local: string[]
|
local: string[]
|
||||||
remote: string[]
|
remote: string[]
|
||||||
|
|||||||
Reference in New Issue
Block a user